On 04/26/2012 12:10 PM, Stefano Lattarini wrote:
> Severity: minor
> 
> Reference: <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11306#11>
> 
> On 04/22/2012 08:10 PM, Bruno Haible wrote:
>>
>> [SNIP]
>>
>> Modifying a test apparently requires me to have the same exact Autoconf
>> version (2.68) as you did. What an annoyance! I have to proceed like this:
>>
>> 1. On a machine with autoconf 2.68:
>>    - Unpack a fresh automake-1.11d directory.
>>    $ ./configure; make           # This is necessary to build 'automake'.
>>    - Then only! change t/lex-libobj.sh
>>    $ make                        # This uses the built 'automake'.
>>    $ make distclean
>> 2. Copy this directory to the target machine (without autoconf 2.68).
>> 3. $ ./configure; make
>>    $ make check TESTS=t/lex-libobj
>>
> I agree this situation is suboptimal and can hinder on-field testing by
> the users that are not automake developers.  I will fix this soonish.
> 
> Thanks,
>   Stefano
> 
And here is a patch.  The change itself is obvious, but I'd like a review
on the long-winded commit message.  I will push by tomorrow if there is no
review by then.

Regards,
  Stefano
>From bc7013f1d87a3da468c90a43b0136a7ef88cbdbf Mon Sep 17 00:00:00 2001
Message-Id: <bc7013f1d87a3da468c90a43b0136a7ef88cbdbf.1335445833.git.stefano.lattar...@gmail.com>
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Thu, 26 Apr 2012 15:05:05 +0200
Subject: [PATCH] build: avoid too greedy rebuilds in the testsuite

The autogenerated makefile fragment 't/testsuite-part.am' used to depend
on the list of *all* the hand-written files.  This was technically correct,
since that makefile fragment was (and still is) generated by the script
'gen-testsuite-part', which scans all the hand-written files to detect
implicit dependencies and to decide for which tests a further wrapper test
should be generated.

However, the presence of such a dependency implied that, whenever *any*
test case was modified (no matter how slightly), the 't/testsuite-part.am'
file was rebuilt, and since that is included by our 'Makefile.am', the
'Makefile.in' file was rebuilt as well by automake.  In order to do so,
automake scanned our 'configure.ac' file, which requires the latest
Autoconf version (2.69 at the time of writing), and the casual user can
easily lack that on his machine (and that should be allowed, as automake
currently supports any autoconf version >= 2.62).

The described situation could hinder hinder on-field testing or debugging
by users (even experienced ones) that are not automake developers; see
for example automake bug#11347.

So we drop the explicit dependency of 't/testsuite-part.am' on the
hand-written test cases.  (As an aside, note that this has already
been done in Automake-NG, albeit for other reasons; see the commit
'v1.11b-129-g1690aca' of 23-40-2012, "[ng] build: define $(TESTS)
through a wildcard").

This is not a serious regression in the faithfulness of the Automake
build systems, since it that already had several undeclared dependencies
unfortunately; e.g., 'Makefile.in' should depend on the automake script,
and 'aclocal.m4' should depend on the aclocal script (but this isn't
possible, as it would mean that distributed files depend on ones generated
at make time).  Similarly, 'Makefile.in' should depend on some of the
'lib/am/*.am' files, but does not.

Currently, the workaround to get a faithful and correct rebuild is to run

  ./bootstrap && ./config.status --recheck && make clean all

and the present commit does not change that.

* Makefile.am ($(srcdir)/t/testsuite-part.am): Don't depend on
't/list-of-tests.mk' nor on '$(handwritten_TESTS)' anymore.
($(generated_TESTS)): Likewise, and don't depend on 'Makefile.am'
either.

Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com>
---
 Makefile.am |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index dc8932d..419c152 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -379,11 +379,11 @@ $(srcdir)/t/testsuite-part.am:
 	$(AM_V_at)mv -f t/testsuite-part.tmp $@
 EXTRA_DIST += gen-testsuite-part
 
-$(generated_TESTS) $(srcdir)/t/testsuite-part.am: \
-  $(srcdir)/gen-testsuite-part \
-  t/list-of-tests.mk \
-  Makefile.am \
-  $(handwritten_TESTS)
+## The dependnecies declared here are not truly complete, but such a
+## completeness would cause more issues than it would solve.  See
+## automake bug#11347.
+$(generated_TESTS): $(srcdir)/gen-testsuite-part
+$(srcdir)/t/testsuite-part.am: $(srcdir)/gen-testsuite-part Makefile.am
 
 # Static dependencies valid for each test case.
 check_SCRIPTS = t/wrap/aclocal-$(APIVERSION) t/wrap/automake-$(APIVERSION)
-- 
1.7.9.5

Reply via email to