[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
burned by Makefile.in.in's $(DOMAIN).pot-update rule
From: |
Jim Meyering |
Subject: |
burned by Makefile.in.in's $(DOMAIN).pot-update rule |
Date: |
Thu, 10 Jun 2010 23:22:21 +0200 |
Hi Bruno,
I ran a "make dist" for coreutils in the background
and went back to work in another window.
A few minutes later, the system becomes 99% unresponsive
(memory abuse) in spite of 8GB of RAM. Keyboard and mouse
respond only after 10-20-second delay, and then only minimally.
This rule is the culprit:
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v
'libtool:' >/dev/null; then \
package_gnu='GNU '; \
else \
package_gnu=''; \
fi; \
I happened to have a sparse file with tiny actual size,
but an apparent size of a terabyte or two, so in a sense
it's my fault -- or maybe grep's for allocating so much
memory while looking for a newline.
grep's resident memory was up to 6GiB(!) when my system
found enough cycles to start "top".
One solution would be to limit the searched files
to those under version control, but that does not seem feasible.
Another is to allow people like me to replace the grep command
with something else. E.g., you'd define something like this,
is_GNU_package_command = \
LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null \
| grep -v 'libtool:' >/dev/null
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
if $(is_GNU_package_command); then \
and thus I'd be able to override it with something
that is adequate for my package, like
AM_MAKEFLAGES=is_GNU_package_command=true
---------------------------
It might even be ok simply to change that line to:
if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/[0A-Z]* 2>/dev/null |
grep -v 'libtool:' >/dev/null; then \
Since I rarely create temporary files whose names start with
"0" or capitals, that would probably keep this from happening
again -- for me.
Any solution would be most welcome.
For now, I'll probably hack it via coreutils' bootstrap script.
Finally, if you want to continue to use that libtool exclusion,
I suggest you anchor its regexp:
- if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v
'libtool:' >/dev/null; then \
+ if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v
'^libtool:' >/dev/null; then \