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

@@ -45,39 +45,14 @@
4545 if: runner.os == 'macOS'
4646 run: echo "/opt/homebrew/opt/coreutils/libexec/gnubin" >> "$GITHUB_PATH"
4747
48- # When every input the test result depends on is unchanged
49- # (test/, compiler source, runtime source, Makefile), the
50- # prior run's `.ok` stamps are still valid. Pulling them down
51- # lets `make test` short-circuit each test via mtime tracking.
52- # The hash key is the sole invalidator — any change to any
53- # input file misses the cache and reruns every test. See
54- # the post-build `touch` step for why mtimes need a refresh.
55- - name: Restore test-results cache
56- uses: actions/cache@v5
57- with:
58- path: build/test-results
59- 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') }}
60-
6148 - name: Fetch libprism sources
6249 run: make deps
6350
64- # CI builds spinel_codegen for testing only — `-O3 -flto` adds
65- # link time on every job (especially Windows) without buying us
66- # anything CI cares about. LTO=0 keeps the local-dev default.
67- - name: Build (parse + regexp + codegen)
51+ # Builds the C compiler (parse + regexp + spinelc). `-O3 -flto`
52+ # adds link time on every job without buying CI anything, so LTO=0.
53+ - name: Build (parse + regexp + spinelc)
6854 run: make -j$(getconf _NPROCESSORS_ONLN) LTO=0 all
6955
70- # `make all` just touched the compiler-binary stamps that every
71- # `.ok` depends on, so without this refresh, make would treat
72- # every cached `.ok` as stale and rerun each test. The cache
73- # key already covers every input that affects the test outcome,
74- # so bumping mtimes here is safe.
75- - name: Refresh test-results mtimes
76- run: |
77- if [ -d build/test-results ]; then
78- find build/test-results -name '*.ok' -exec touch {} +
79- fi
80-
8156 - name: Run tests
8257 # OPT=-O0 cuts cc time per test (each .rb compiles its own
8358 # generated C with $(CFLAGS) -Werror). Type-checking still
@@ -170,26 +145,11 @@
170145 make --version | head -1
171146 sccache --version
172147
173- # See the posix job for the cache contract. Windows is the
174- # biggest beneficiary because its per-test fork-exec cost
175- # dwarfs the cache-restore step.
176- - name: Restore test-results cache
177- uses: actions/cache@v5
178- with:
179- path: build/test-results
180- 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') }}
181-
182148 - name: Fetch libprism sources
183149 run: make deps
184150
185- - name: Build (parse + regexp + codegen)
151+ - name: Build (parse + regexp + spinelc)
186152 run: make -j$(nproc) LTO=0 all
187-
188- - name: Refresh test-results mtimes
189- run: |
190- if [ -d build/test-results ]; then
191- find build/test-results -name '*.ok' -exec touch {} +
192- fi
193153
194154 - name: Run tests
195155 run: make -j$(nproc) test OPT=-O0