autoconf-patches
[Top][All Lists]
Advanced

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

Avoid a race condition that would make parallel "distclean" fail.


From: Jim Meyering
Subject: Avoid a race condition that would make parallel "distclean" fail.
Date: Sat, 10 Nov 2007 22:32:16 +0100

With this patch, I think we can finally remove the note about
building with -jN being unsafe.

If someone can propose a way to solve this without duplicating-in-
Makefile.am the rule normally generated by automake for
distclean-generic, that'd be better.

        Avoid a race condition that would make parallel "distclean" fail.
        * tests/Makefile.am (distclean-generic): Replace the default,
        automake-provided rule with an identical one, but with an additional
        dependency on distclean-local.  Simply adding the dependency would
        cause automake not to emit the rule at all.

---
 ChangeLog         |    6 ++++++
 tests/Makefile.am |    9 +++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6a64b62..7934933 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2007-11-10  Jim Meyering  <address@hidden>

+       Avoid a race condition that would make parallel "distclean" fail.
+       * tests/Makefile.am (distclean-generic): Replace the default,
+       automake-provided rule with an identical one, but with an additional
+       dependency on distclean-local.  Simply adding the dependency would
+       cause automake not to emit the rule at all.
+
        Distribute git-version-gen.
        * Makefile.am (EXTRA_DIST): Add build-aux/git-version-gen,
        since GNUmakefile is distributed, and requires it for dist* rules.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index ed129fd..e069a0a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -120,6 +120,15 @@ $(TESTSUITE): $(srcdir)/package.m4 \
 atconfig: $(top_builddir)/config.status
        cd $(top_builddir) && ./config.status tests/$@

+# Avoid a race condition that would make parallel "distclean" fail.
+# The rule in clean-local tests for existence of $(TESTSUITE), and
+# if found, attempts to run it.  But the distclean-generic rule may
+# be running in parallel, and it removes $(DISTCLEANFILES) which
+# includes $(TESTSUITE).
+distclean-generic: clean-local
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
 clean-local:
        test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
        rm -f *.tmp
--
1.5.3.5.622.g6fd7a




reply via email to

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