summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Lee <ron@debian.org>2014-07-31 16:29:43 +0930
committerH. Peter Anvin <hpa@linux.intel.com>2014-07-31 16:25:41 -0700
commitff819b108a14f40612ebfb15937ae4a1b632bab9 (patch)
treed49f9de56f8b9072e22f3a7e50e78a8a85de8bab
parent3ee2b278091ac0c60e9077096afa2135708de5e4 (diff)
downloadtftp-hpa-ff819b108a14f40612ebfb15937ae4a1b632bab9.tar.gz
Make configure an order-only prerequisite of aconfig.h.in
On filesystems with subsecond resolution, like ext4, we can't trust the timestamp of aconfig.h.in since autoheader leaves it truncated to second resolution (apparently touch -r and cp -p can do this at the very least) while configure has full subsecond resolution, so it can look newer even when it was cleanly created first, leading to the build system looping trying to recreate all of that again ... So in the initial stage of a clean build we can get something like this: $ make spotless $ make autoconf rm -rf MCONFIG configure config.log aconfig.h *.cache autoconf rm -f aconfig.h.in aconfig.h autoheader $ stat configure aconfig.h.in File: ‘configure’ Device: 807h/2055d Inode: 9443466 Links: 1 Access: 2014-07-31 03:27:27.599293442 +0930 Modify: 2014-07-31 03:27:27.711290270 +0930 Change: 2014-07-31 03:27:27.711290270 +0930 File: ‘aconfig.h.in’ Device: 807h/2055d Inode: 9443467 Links: 1 Access: 2014-07-31 03:27:27.000000000 +0930 Modify: 2014-07-31 03:27:27.000000000 +0930 Change: 2014-07-31 03:27:27.903284841 +0930 And with a parallel build, that can then leave 'make all' racing to remove and recreate aconfig.h (and possibly more things), while it begins to build the first targets. Which then fail horribly like we see here: https://buildd.debian.org/status/fetch.php?pkg=tftp-hpa&arch=i386&ver=5.2%2B20140608-1&stamp=1406736363 Possibly we also need to move the actual build job into the rule for the 'all' target, so that the build system update prerequisites are guaranteed to be completed before it runs (as opposed to running in parallel with them), but this change might be enough for now. Signed-off-by: Ron Lee <ron@debian.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 9ff12d8..75a2042 100644
--- a/Makefile
+++ b/Makefile
@@ -58,8 +58,12 @@ aconfig.h: MCONFIG
# Adding "configure" to the dependencies serializes this with running
# autoconf, because there are apparently race conditions between
-# autoconf and autoheader.
-aconfig.h.in: configure.in configure aclocal.m4
+# autoconf and autoheader. And worse than that, even when autoconf
+# cleanly returns first, autoheader will truncate the timestamp of
+# aconfig.h.in to second resolution, so on a filesystem with subsecond
+# resolution it can appear older than configure (which isn't truncated).
+# So make it an order-only prerequisite to avoid looping regenerating it.
+aconfig.h.in: configure.in aclocal.m4 | configure
rm -f aconfig.h.in aconfig.h
autoheader