Commit 43dc1284
43dc1284130eMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 1 file · ~1 modified
Description
Add make check and make gate developer gate targets
The full local gate is dominated by the self-host bootstrap (~230s, roughly 3x test+bench+optcarrot combined). test/bench/optcarrot only read the compiler binaries and write to disjoint build/ dirs, so they can run concurrently; only the bootstrap rewrites spinel_{analyze, codegen} (round-3 cp) and must run alone.
make gate: runs test || bench || optcarrot in parallel (as the gate-legs prerequisites), then the self-host bootstrap. ~305s vs ~405s sequential. The full pre-push gate in one command.make check: rebuilds the compiler and runs the full test suite with the optimizer off, skipping bench/optcarrot/bootstrap (~75s). The fast pre-commit confidence check.
Both build with LTO=0 (the dev/CI fast convention) so the rebuild isn't paying the -O3 -flto link of the ~80k-line generated C.
The legs run as parallel prerequisites driven by make's own jobserver,
and every recursive $(MAKE) is +-prefixed so the jobserver fd is
inherited rather than a hand-rolled -jN & loop; none pass an explicit
-j (which would make a sub-make reset the jobserver and spawn its own
pool). The targets are local-only (CI calls all/test directly) and rely
on the existing default--j logic, which already handles GNU Make 3.81
on macOS.
Co-Authored-By: Claude Opus 4.8 [email protected]
Details
- Commit
- 43dc1284130e
- Parent
- 1e7d63da5252
MakefilemodifiedView file
COMPILER_HELPERS_STAMP := build/stamps/compiler_helpers.rb.stampPARSE_STAMP := build/stamps/spinel_parse.c.stamp.PHONY: all parse bootstrap bootstrap-fixpoint fast-bootstrap codegen rbs_extract rbs-test regen-rbs-expected test retest fast-test clean-test-results regen-expected bench optcarrot clean install uninstall deps FORCE.PHONY: all parse bootstrap bootstrap-fixpoint fast-bootstrap codegen rbs_extract rbs-test regen-rbs-expected test retest fast-test clean-test-results regen-expected bench optcarrot gate check gate-legs gate-test gate-bench gate-optcarrot clean install uninstall deps FORCE# `make all` includes spinel_rbs_extract when vendor/rbs has been# fetched (via `make deps`). Without vendor/rbs the extractor is exit 1; \ fi# ---- Developer gates ----## Two composite targets to cut the edit/verify loop. The full gate is# dominated by the self-host bootstrap (~3x the rest); `test`, `bench`# and `optcarrot` only READ the compiler binaries and write to disjoint# build/ dirs, so they run concurrently as parallel prerequisites, while# `bootstrap` rewrites spinel_{analyze,codegen} (round-3 cp) and must run# alone afterward.## These rely on make's own jobserver rather than a hand-rolled `-jN` +# `&` background loop: every recursive `$(MAKE)` is `+`-prefixed so the# jobserver fd is inherited (no "jobserver unavailable -> -j1" fallback),# and none pass an explicit `-j` (which would force a sub-make to reset# the jobserver and spawn its own full pool -> oversubscription). The# default-`-j` logic above gives the top-level invocation its pool.# Fast pre-commit check: rebuild the compiler and run the full test# suite with the optimizer off (type-checking still happens). Skips# bench/optcarrot/bootstrap — run `make gate` before pushing for those.# LTO=0 keeps the compiler rebuild fast (no -O3 -flto link of the ~80k# line generated C); it doesn't affect type-checking or test output.check: +@$(MAKE) --no-print-directory LTO=0 all +@$(MAKE) --no-print-directory clean-test-results +@$(MAKE) --no-print-directory test OPT=-O0# Full pre-push gate: test || bench || optcarrot in parallel (via the# gate-legs prerequisites), then the self-host bootstrap. ~90s faster# than the four in sequence.gate: +@$(MAKE) --no-print-directory LTO=0 all +@$(MAKE) --no-print-directory clean-test-results +@$(MAKE) --no-print-directory gate-legs +@$(MAKE) --no-print-directory LTO=0 bootstrap @echo "gate: ALL GREEN"# The three read-only legs as parallel prerequisites; make schedules# them across the jobserver pool.gate-legs: gate-test gate-bench gate-optcarrotgate-test: +@$(MAKE) --no-print-directory test OPT=-O0gate-bench: +@$(MAKE) --no-print-directory benchgate-optcarrot: +@$(MAKE) --no-print-directory optcarrot# ---- Install ----PREFIX ?= /usr/local