Commit bf0d02eb
bf0d02eb0409Merged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 1 file · ~1 modified
Description
Fix macOS-only flaky build: drop &: from the fast-bootstrap rule
The fast-bootstrap rule used a GNU Make 4.3 &: grouped target to run the
helper once for both spinel_analyze and spinel_codegen. macOS's system Make
is 3.81, which predates &: and runs the recipe once PER target -- two
concurrent tools/fast-bootstrap helpers, each exec'ing make FAST_BOOTSTRAP=0,
racing on the shared build/*.ast / *.ir intermediates. The corrupted IR then
yields "use of undeclared identifier" in codegen1.c. Timing-dependent, so it
surfaced intermittently on macOS only.
Drop the grouped target: spinel_analyze carries the helper recipe (which produces both binaries) and spinel_codegen just depends on it, so the helper runs exactly once. Both source stamps remain prereqs of spinel_analyze, so any compiler-source edit still re-runs it.
Co-Authored-By: Claude Opus 4.8 [email protected]
Details
- Commit
- bf0d02eb0409
- Parent
- fdc93fdef75a
MakefilemodifiedView file
ifeq ($(FAST_BOOTSTRAP),auto)# Default: rebuild BOTH compiler binaries from the previous binaries (stage0)# via tools/fast-bootstrap, gated on the source stamps. Grouped target (&:)# runs the helper once for both. Helper falls back to the CRuby rules# (FAST_BOOTSTRAP=0) when stage0 is missing or can't compile the source.spinel_analyze$(EXE) spinel_codegen$(EXE) &: $(ANALYZE_STAMP) $(CODEGEN_STAMP) $(NODE_TABLE_LOADER_STAMP) $(COMPILER_HELPERS_STAMP) $(SP_RT_LIB) | spinel_parse$(EXE)# via tools/fast-bootstrap, gated on the source stamps. Helper falls back to# the CRuby rules (FAST_BOOTSTRAP=0) when stage0 is missing or can't compile# the source.## spinel_analyze carries the recipe and the helper produces BOTH binaries;# spinel_codegen just waits on it. We deliberately do NOT use a `&:` grouped# target: macOS's system Make (GNU Make 3.81) predates `&:` and runs the recipe# once PER target, spawning two concurrent helpers that race on the shared# build/*.ast / *.ir intermediates (a flaky macOS-only build break -- corrupt# IR -> "undeclared identifier" in codegen1.c). Listing both source stamps as# prereqs of spinel_analyze means any compiler-source edit re-runs the helper.spinel_analyze$(EXE): $(ANALYZE_STAMP) $(CODEGEN_STAMP) $(NODE_TABLE_LOADER_STAMP) $(COMPILER_HELPERS_STAMP) $(SP_RT_LIB) | spinel_parse$(EXE) @CC='$(CC)' EXE='$(EXE)' BOOTSTRAP_CFLAGS='$(BOOTSTRAP_CFLAGS)' SP_RT_LIB='$(SP_RT_LIB)' LDFLAGS='$(LDFLAGS)' sh tools/fast-bootstrapspinel_codegen$(EXE): spinel_analyze$(EXE) @:elsespinel_analyze$(EXE): build/analyze1.c $(SP_RT_LIB) $(CC) $(BOOTSTRAP_CFLAGS) -Ilib build/analyze1.c $(SP_RT_LIB) $(LDFLAGS) -lm -o spinel_analyze$(EXE)