bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] Re: tracing from aclocal


From: Akim Demaille
Subject: [Bug-gnulib] Re: tracing from aclocal
Date: Tue, 19 Aug 2003 09:29:02 +0200
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

| Here is a patch for this.  As always, a better name is welcome.
| 
| 2003-08-18  Alexandre Duret-Lutz  <address@hidden>
| 
|       * lib/autom4te.in (Autoconf): Move all args except aclocal.m4? into ...
|       (Autoconf-without-aclocal-m4): ... this new language.
|       * doc/autoconf.texi (autom4te Invocation): Mention
|       Autoconf-without-aclocal-m4.

Fine, please, install!


|  >> As I understand it, this is because the second version of
|  >> aclocal.m4 overrides the first within the same second, so
|  >> autom4te sees the same timestamp.  If aclocal sleeps for
|  >> 1sec between both writes, then caching does not occur (as
|  >> expected).
| 
|  Akim> Indeed.  That's something Paul Eggert tracked down, and solved in
|  Akim> autoreconf:
| 
|  Akim> if (!$uses_aclocal)
|  Akim> {
|  Akim> verbose "$configure_ac: not using aclocal";
|  Akim> }
|  Akim> else
|  Akim> {
|  Akim> # Some filesystems have sub-second time stamps, and if so we may
|  Akim> # run into trouble later, after we rerun autoconf and set the
|  Akim> # time stamps of input files to be no greater than aclocal.m4,
|  Akim> # because the time-stamp-setting operation (utime) has a
|  Akim> # resolution of only 1 second.  Work around the problem by
|  Akim> # ensuring that there is at least a one-second window before the
|  Akim> # time stamp of aclocal.m4t in which no file time stamps can
|  Akim> # fall.
|  Akim> sleep 1;
| 
|  Akim> run_aclocal ($aclocal, $aclocal_flags);
|  Akim> }
| 
| If I follow this comment correctly, the sleep(1) is useless
| with CVS aclocal.  Today it could as well be written
| 
|    sleep 1 unless $aclocal_supports_force;
| 
| couldn't it?  Because utime() is not used if $aclocal_supports_force.

Err, this was also to pacify Make.  We try to ensure that aclocal.m4
is younger, with "younger" being in the sense of all the participants.

| That seems a different issue.  This one is caused by the use of
| utime() which can _set_ the time stamp to an value older than its
| original setting; while I'm somehow talking about the converse:
| autom4te misses updates because it is _reading_ time stamps with
| a 1sec resolution.

OK.

|  Akim> Is this really all that can do a modern system?  A one
|  Akim> second accuracy on time stamps?
| 
| Can't answer that one, but why focus on time stamps?  autom4te
| could use checksums instead (at least when time stamps look
| equal).

Yep, that's the only viable alternative.  I guess this will cost
something :(

Gee, the TODO list is growing :(


|  Akim> M4 is currently a serious bottleneck in our tool chain.  I'm not found
|  Akim> of making this worse.  I might not understand fully what you are
|  Akim> referring to (maybe it's time to have a diner together :), but it
|  Akim> seems to me that that would introduce superfluous runs in some cases.
| 
| We have two runs of autom4te.  One during aclocal, one during autoconf.
| 
| In the first run, many useless files are read
| 
|    configure.ac m4/a.m4 m4/b.m4 /usr/share/aclocal/c.m4 
/usr/share/aclocal/d.m4
| 
| In the second run, only a subset of these files remain, plus aclocal.m4
| 
|    configure.ac aclocal.m4 m4/a.m4
| (aclocal.m4 might contain a copy of d.m4, and m4_include a.m4)
| 
| Essentially what I'm saying is that the second run cannot share
| the cache of the first run, because we do not know about the
| side effects of all the omitted macros.  (Considering the output
| of --trace=AC_DEFUN in both cases might be another
| justification.)

You are right :(


| Here is an updated patch.  It uses the new language introduced
| above, and do not use any temporary file (such as the
| aclocal.t2): aclocal just passes all the M4 files on the
| autom4te command line, as in your example.
| 
| 2003-08-18  Alexandre Duret-Lutz  <address@hidden>
| 
|       * aclocal.in (write_aclocal): Take an output file and a list of
|       used macros in arguments and make up the file contents here.
|       (trace_used_macros): New function.
|       (add_file): Do not update $output.
|       ($output): Delete.
|       (MAIN): Call trace_used_macros.  Then rewrite aclocal.m4 only
|       for these traced macros.  This should shorten aclocal.m4 by
|       stripping out unused macros.
|       * tests/aclibobj.test: Make sure configure.in exists by the time
|       aclocal runs.
|       * tests/aclocal8.test: New file.
|       * tests/Makefile.am (TESTS): Add aclocal8.test.
|       Suggested by Bruno Haible and Akim Demaille.

Great!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]