1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-04-28 06:33:36 +00:00

maint.mk: fix sc_Wundef_boolean race with parallel syntax-check

With highly parallel "make syntax-check", sc_Wundef_boolean's
in_files='config.h' was matched as an unanchored, unescaped regex
by "find | grep -E", so the '.' matched any character and the lack
of anchoring matched anywhere in a path.  This made it match the
.sc-start-sc_*config_h* marker files created by parallel rules.
Symptom: I saw see these go by:
  grep: ./.sc-start-sc_require_config_h_first: No such file or directory
  grep: ./.sc-start-sc_prohibit_have_config_h: No such file or directory
  grep: ./.sc-start-sc_require_config_h: No such file or directory
* top/maint.mk (sc_Wundef_boolean): Use '(^|/)config\.h$' rather
than bare 'config.h' as the in_files ERE.
This commit is contained in:
Jim Meyering
2026-04-19 19:36:03 -07:00
committed by Jim Meyering
parent fb7312fa8d
commit 15211966de
2 changed files with 16 additions and 1 deletions

View File

@@ -1,3 +1,18 @@
2026-04-19 Jim Meyering <meyering@fb.com>
maint.mk: fix sc_Wundef_boolean race with parallel syntax-check
With highly parallel "make syntax-check", sc_Wundef_boolean's
in_files='config.h' was matched as an unanchored, unescaped regex
by "find | grep -E", so the '.' matched any character and the lack
of anchoring matched anywhere in a path. This made it match the
.sc-start-sc_*config_h* marker files created by parallel rules.
Symptom: I saw see these go by:
grep: ./.sc-start-sc_require_config_h_first: No such file or directory
grep: ./.sc-start-sc_prohibit_have_config_h: No such file or directory
grep: ./.sc-start-sc_require_config_h: No such file or directory
* top/maint.mk (sc_Wundef_boolean): Use '(^|/)config\.h$' rather
than bare 'config.h' as the in_files ERE.
2026-04-19 Paul Eggert <eggert@cs.ucla.edu>
regex tests: pacify -Wshadow

View File

@@ -1475,7 +1475,7 @@ sc_prohibit_reversed_compare_failure:
# and the 'bool' module supports it.
sc_Wundef_boolean:
@prohibit='^#define.*(yes|no)$$' \
in_files='$(CONFIG_INCLUDE)' \
in_files='(^|/)$(subst .,\.,$(CONFIG_INCLUDE))$$' \
halt='Use 0/1 or false/true for macro values' \
$(_sc_search_regexp)