Commit cd6106b9
cd6106b9b2cfMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 7 files · +2 added · ~3 modified · -2 deleted
Description
Build system: split legacy into legacy/Makefile, drop fast-bootstrap, fold retest into test
Three related cleanups to the build:
-
Extract shared toolchain config (CC/ccache wrapping, CFLAGS, LTO, BOOTSTRAP_CFLAGS, timeouts, content-stamp infra) into common.mk, included by both the root Makefile and the new legacy/Makefile.
-
Move the legacy Ruby compiler (spinel_analyze/spinel_codegen) bootstrap and self-host fixpoint into legacy/Makefile. The root Makefile now builds only the C compiler (parse + regexp + spinelc); 'make legacy' and 'make bootstrap' delegate to legacy/. The legacy-analyzer analyze-fail diagnostics move there too and run under 'make gate' rather than the hot 'make test' loop. Verified the 4-way fixpoint still passes via the delegated path.
-
Remove the fast-bootstrap machinery (tools/fast-bootstrap, the FAST_BOOTSTRAP=auto path, docs/fast-bootstrap.md); the legacy compiler is always rebuilt via the CRuby authority round.
-
'make test' now always runs fresh (it wipes the prior .ok stamps then runs), folding in the old 'retest'/'fast-test' targets. A stale .ok reading PASS was a recurring foot-gun, so incremental test caching (and the corresponding CI cache steps) are dropped.
Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
Details
- Commit
- cd6106b9b2cf
- Parent
- e751fe677c60
.github/workflows/ci.ymlmodifiedView file
if: runner.os == 'macOS' run: echo "/opt/homebrew/opt/coreutils/libexec/gnubin" >> "$GITHUB_PATH" # When every input the test result depends on is unchanged # (test/, compiler source, runtime source, Makefile), the # prior run's `.ok` stamps are still valid. Pulling them down # lets `make test` short-circuit each test via mtime tracking. # The hash key is the sole invalidator — any change to any # input file misses the cache and reruns every test. See # the post-build `touch` step for why mtimes need a refresh. - name: Restore test-results cache uses: actions/cache@v5 with: path: build/test-results key: tests-${{ matrix.os }}-${{ matrix.cc }}-${{ hashFiles('test/**', 'spinel_parse.c', 'spinel_analyze.rb', 'spinel_codegen.rb', 'compiler_helpers.rb', 'node_table_loader.rb', 'lib/**', 'Makefile') }} - name: Fetch libprism sources run: make deps # CI builds spinel_codegen for testing only — `-O3 -flto` adds # link time on every job (especially Windows) without buying us # anything CI cares about. LTO=0 keeps the local-dev default. - name: Build (parse + regexp + codegen) # Builds the C compiler (parse + regexp + spinelc). `-O3 -flto` # adds link time on every job without buying CI anything, so LTO=0. - name: Build (parse + regexp + spinelc) run: make -j$(getconf _NPROCESSORS_ONLN) LTO=0 all # `make all` just touched the compiler-binary stamps that every # `.ok` depends on, so without this refresh, make would treat # every cached `.ok` as stale and rerun each test. The cache # key already covers every input that affects the test outcome, # so bumping mtimes here is safe. - name: Refresh test-results mtimes run: | if [ -d build/test-results ]; then find build/test-results -name '*.ok' -exec touch {} + fi - name: Run tests # OPT=-O0 cuts cc time per test (each .rb compiles its own # generated C with $(CFLAGS) -Werror). Type-checking still make --version | head -1 sccache --version # See the posix job for the cache contract. Windows is the # biggest beneficiary because its per-test fork-exec cost # dwarfs the cache-restore step. - name: Restore test-results cache uses: actions/cache@v5 with: path: build/test-results key: tests-windows-mingw-gcc-${{ hashFiles('test/**', 'spinel_parse.c', 'spinel_analyze.rb', 'spinel_codegen.rb', 'compiler_helpers.rb', 'node_table_loader.rb', 'lib/**', 'Makefile') }} - name: Fetch libprism sources run: make deps - name: Build (parse + regexp + codegen) - name: Build (parse + regexp + spinelc) run: make -j$(nproc) LTO=0 all - name: Refresh test-results mtimes run: | if [ -d build/test-results ]; then find build/test-results -name '*.ok' -exec touch {} + fi - name: Run tests run: make -j$(nproc) test OPT=-O0MakefilemodifiedView file
Loading diff…
README.mdmodifiedView file
Loading diff…
common.mkaddedView file
Loading diff…
docs/fast-bootstrap.mddeleted
Loading diff…
legacy/MakefileaddedView file
Loading diff…
tools/fast-bootstrapdeleted
Loading diff…