[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
avoiding parallel build failures
From: |
Jim Meyering |
Subject: |
avoiding parallel build failures |
Date: |
Thu, 23 Apr 2009 21:33:31 +0200 |
I've hit some more parallel build failures, due to
the way some of the "make syntax-check" rules were interacting:
one of the frequent culprits, check-AUTHORS, would be building
executables in src while another rule (sc_tight_scope), running
in parallel building some of the same files, was removing essential bits.
This made me realize that check-AUTHORS doesn't even belong in
maint.mk or even cfg.mk. So I've moved it.
>From cbc4d9bd1366b0ed277b5dfe2585d22d4070e969 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 23 Apr 2009 08:21:38 +0200
Subject: [PATCH 1/2] avoid parallel "make distcheck" failure due to two
run-in-src/ rules
Move the check-AUTHORS rule from "syntax-check" to "check".
* maint.mk (local-checks-available): Remove check-AUTHORS.
(check-AUTHORS): Remove rule.
* src/Makefile.am (CLEANFILES): Add $(no_install__progs),
since they too are built sometimes.
(check-AUTHORS): Split a longer-than-80 sed command.
(../AUTHORS): Remove obsolete rule.
---
maint.mk | 6 +-----
src/Makefile.am | 34 +++++++---------------------------
2 files changed, 8 insertions(+), 32 deletions(-)
diff --git a/maint.mk b/maint.mk
index 8777a99..5ef1fe6 100644
--- a/maint.mk
+++ b/maint.mk
@@ -73,7 +73,7 @@ syntax-check-rules := $(shell sed -n
's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' \
local-checks-available = \
$(syntax-check-rules) \
- makefile-check check-AUTHORS
+ makefile-check
.PHONY: $(local-checks-available)
# Arrange to print the name of each syntax-checking rule just before running
it.
@@ -483,10 +483,6 @@ update-NEWS-hash: NEWS
perl -pi -e 's/^(old_NEWS_hash = ).*/$${1}'"$(NEWS_hash)/" \
$(srcdir)/cfg.mk
-ALL_RECURSIVE_TARGETS += check-AUTHORS
-check-AUTHORS:
- $(MAKE) -C src $@
-
# Ensure that we use only the standard $(VAR) notation,
# not @...@ in Makefile.am, now that we can rely on automake
# to emit a definition for each substituted variable.
diff --git a/src/Makefile.am b/src/Makefile.am
index 9aaf739..be134be 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -69,6 +69,10 @@ EXTRA_DIST = dcgen dircolors.hin tac-pipe.c \
BUILT_SOURCES =
CLEANFILES = $(SCRIPTS) su
+# Also remove these sometimes-built programs.
+# For example, even when excluded, they're built via check-AUTHORS.
+CLEANFILES += $(no_install__progs)
+
AM_CPPFLAGS = -I$(top_srcdir)/lib
noinst_LIBRARIES = libver.a
@@ -359,7 +363,7 @@ pm = progs-makefile
pr = progs-readme
# Ensure that the list of programs in README matches the list
# of programs we can build.
-check: check-README check-duplicate-no-install
+check: check-README check-duplicate-no-install check-AUTHORS
.PHONY: check-README
check-README:
rm -rf $(pr) $(pm)
@@ -394,36 +398,12 @@ check-AUTHORS: $(all_programs)
fi; \
LC_ALL=en_US.UTF-8 ./$$exe --version \
| perl -0 -pi -e 's/,\n/, /gm' \
- |sed -n '/Written by /{ s//'"$$i"': /; s/,* and /, /; s/\.$$//; p;
}'; \
+ | sed -n -e '/Written by /{ s//'"$$i"': /;' \
+ -e 's/,* and /, /; s/\.$$//; p; }'; \
done > $(au_actual)
@sed -n '/^[^ ][^ ]*:/p' $(top_srcdir)/AUTHORS > $(au_dotdot)
@diff $(au_actual) $(au_dotdot) && rm -f $(au_actual) $(au_dotdot)
-# Extract the list of authors from each file.
-sed_filter = s/^ *//;s/N_ (//;s/^"//;s/")*$$//
-# Sometimes the string is on the same line as the #define...
-s1 = '/^\#define AUTHORS \([^\\]\)/{;s//\1/;$(sed_filter);p;q;}'
-# Sometimes the string is on the backslash-continued line after the #define.
-s2 = '/^\#define AUTHORS \\\\/{;n;$(sed_filter);p;q;}'
-../AUTHORS: $(SOURCES)
- rm -f address@hidden
- ( \
- set -e; \
- echo "Here are the names of the programs in this package,"; \
- echo "each followed by the name(s) of its author(s)."; \
- echo; \
- for i in $(SOURCES); do \
- a=`sed -n $(s1) $$i`; \
- test "$$a" && : \
- || a=`sed -n $(s2) $$i`; \
- if test "$$a"; then \
- prog=`echo $$i|sed 's/\.c$$//'`; \
- echo "$$prog: $$a"; \
- fi; \
- done | $(ASSORT) -u ) > address@hidden
- chmod a-w address@hidden
- mv address@hidden $@
-
# The following rule is not designed to be portable,
# and relies on tools that not everyone has.
--
1.6.3.rc1.205.g37f8
>From f41f926aab38d52734b3908eeb0496ebf1285cbd Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 23 Apr 2009 08:45:51 +0200
Subject: [PATCH 2/2] tests: make the check-AUTHORS test more portable, now that
it's...
run as part of "make check".
* src/Makefile.am (check-AUTHORS): Don't depend on en_US.UTF-8.
Instead, use the French UTF8 locale, if configure found one.
If not found, just skip the test.
---
src/Makefile.am | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index be134be..a266d7b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -382,12 +382,17 @@ check-duplicate-no-install: tr
test -z "`echo '$(EXTRA_PROGRAMS)'| ./tr ' ' '\n' | uniq -d`"
# Ensure that the list of programs and author names is accurate.
+# We need a UTF8 locale, and any one should do, but since configure
+# already tries to find a French one, use it. It's fine to skip this test.
au_dotdot = authors-dotdot
au_actual = authors-actual
.PHONY: check-AUTHORS
check-AUTHORS: $(all_programs)
- @rm -f $(au_actual) $(au_dotdot)
- @for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \
+ @locale='$(LOCALE_FR_UTF8)'; \
+ case "$$locale" in \
+ ''|none) echo "$@: skipping this check"; exit 0;; esac; \
+ rm -f $(au_actual) $(au_dotdot); \
+ for i in `ls $(all_programs) | sed -e 's,$(EXEEXT)$$,,' \
| $(ASSORT) -u`; do \
test "$$i" = '[' && continue; \
exe=$$i; \
@@ -396,7 +401,7 @@ check-AUTHORS: $(all_programs)
elif test "$$i" = test; then \
exe='['; \
fi; \
- LC_ALL=en_US.UTF-8 ./$$exe --version \
+ LC_ALL="$$locale" ./$$exe --version \
| perl -0 -pi -e 's/,\n/, /gm' \
| sed -n -e '/Written by /{ s//'"$$i"': /;' \
-e 's/,* and /, /; s/\.$$//; p; }'; \
--
1.6.3.rc1.205.g37f8
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- avoiding parallel build failures,
Jim Meyering <=