>From bc7013f1d87a3da468c90a43b0136a7ef88cbdbf Mon Sep 17 00:00:00 2001 Message-Id: From: Stefano Lattarini 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 --- 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