Repository navigation
ci(compile-smoke): darwin leg + msys cross compile with teeth - #137
Merged
Merged
Conversation
ruby#122: the release-src smoke gate covered linux-gnu/linux-musl/msys only, so the darwin-specific hunks compiled in no gated leg. The smoke universe (Tfs::Versions::SMOKE_ONLY_SCENARIOS) now adds darwin: a darwin tree exists for every version (the base selection plus the _darwin features) even though no darwin tarball ships. _darwin patch attribution moves from the empty set to the smoke-only darwin scenario, and base patches attribute it too; the build universe is unchanged (no darwin build row exists to match). The release smoke job runs darwin legs on macos-latest, and lint-patches gains the same compile gate at change time (tools/smoke_matrix diffed previous-release..HEAD), so an uncompilable patch fails on the PR instead of at the release. ruby#109: the msys leg ran configure without CC, so a POSIX host configured a HOST tree — _WIN32 undefined, the windows half of every patch never compiled, and the leg greened regardless. CC is now pinned to x86_64-w64-mingw32-gcc, a missing cross compiler is a named error. Under the real cross compile the 3.4 prism_compile_memfs patches no longer type-check: they passed the CRT struct stat (32-bit st_size on mingw) to tebako_fs_fstat, which fills the pinned 56-byte tebako_stat — fix both call sites to the struct tebako_stat shape the 4.0 line already carries. The ci/include stub itself already matches the c_api authority byte-for-byte on the declared surface (verified); it is not the drift.
Comment on lines
+58
to
+83
| name: plan the compile-smoke legs | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| smoke: ${{ steps.emit.outputs.smoke }} | ||
| smoke_count: ${{ steps.emit.outputs.smoke_count }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: fetch tags (previous-release diff base) | ||
| run: git fetch --tags --force | ||
| - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0 | ||
| with: | ||
| ruby-version: "3.2" | ||
| - id: emit | ||
| run: | | ||
| smoke=$(tools/smoke_matrix "change-$GITHUB_SHA") | ||
| { | ||
| echo "smoke=$smoke" | ||
| # The count drives the job-level if: on the smoke job (an | ||
| # unguarded empty matrix poisons the run conclusion). | ||
| echo "smoke_count=$(jq '.include | length' <<< "$smoke")" | ||
| } >> "$GITHUB_OUTPUT" | ||
| echo "plan: change=$GITHUB_SHA smoke legs=$smoke" | ||
|
|
||
| smoke: |
Comment on lines
+84
to
+105
| name: smoke (${{ matrix.version }} / ${{ matrix.platform }}) | ||
| needs: smoke-plan | ||
| if: needs.smoke-plan.outputs.smoke_count != '0' | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJSON(needs.smoke-plan.outputs.smoke) }} | ||
| runs-on: ${{ matrix.platform == 'darwin' && 'macos-latest' || 'ubuntu-latest' }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0 | ||
| with: | ||
| ruby-version: "3.2" | ||
| - name: scenario toolchain | ||
| if: ${{ matrix.platform != 'darwin' }} | ||
| run: | | ||
| sudo apt-get update -qq | ||
| case "${{ matrix.platform }}" in | ||
| linux-musl) sudo apt-get install -y -qq musl-tools ;; | ||
| msys) sudo apt-get install -y -qq gcc-mingw-w64-x86-64 ;; | ||
| esac | ||
| - name: configure + compile patched translation units | ||
| run: tools/compile_smoke "${{ matrix.version }}" "$PWD/build/compile-smoke" --platform "${{ matrix.platform }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
#122 — no darwin compile smoke. The release-src compile gate (
tools/smoke_matrix→_release-line.yml) planned legs only over the shipped scenarios (linux-gnu/linux-musl/msys).Tfs::ReleaseDiffattributed a_darwinpatch to the empty set — "no shipped scenario" — so the patch set's darwin-specific hunks (config_status_mainlibs_darwin.patch,configure_extstatic_bundle_loader_darwin.patch, the darwin paths of every base patch) compiled in no gated leg, ever. A darwin-only compile break would ship in the src release and surface downstream in the runtime factory.#109 — the msys smoke never compiled
_WIN32code, and a 3.4 patch drifted from the c_api ABI.tools/compile_smoke --platform msysranconfigure --host=x86_64-w64-mingw32without pinningCC. Ruby's configure then used the host cc: the tree configured for the host,_WIN32stayed undefined, and the windows half of every patch — exactly the code the msys scenario exists to compile — was never built, while the leg stayed green. Under a real cross gcc (x86_64-w64-mingw32-gcc16.1.0) the hole surfaces immediately:The drift is in the 3.4
prism_compile_memfspatches, not theci/includestub. The stub is byte-identical with the c_api authority (the product repo'sinclude/tebako/fs/c_api.h, the header the runtime factory's link unit vendors) on the whole declared surface — the pinnedstruct tebako_statblock and both declarations:The 3.4 patches declared the CRT
struct stat sb(32-bitst_sizeon mingw) and passed it totebako_fs_fstat, which fills the pinned 56-bytetebako_stat— invisible while the msys smoke compiled no_WIN32code, an error under any recent cross gcc (and a stack overflow waiting to happen on the msys line: the callee writes 56 bytes into a smaller struct). The 4.0 line already carries the correct shape (struct tebako_stat sb;); 3.4 lagged.The fix
patches/3.4/prism_compile_memfs{,_6}.patch— the call sites now usestruct tebako_stat sb;, mirroring the 4.0 line's patch verbatim (comment included). Hunk offsets adjusted;tools/lintverifies every 3.4 version still applies cleanly.tools/compile_smoke—CCis pinned tox86_64-w64-mingw32-gccfor the msys scenario, and a pinned cross compiler that is not onPATHis a named error with an install hint (never a silent host-tree smoke).Tfs::Versions::SMOKE_ONLY_SCENARIOS = %w[darwin]: no darwin tarball ships (the darwin tree is the base selection plus the_darwinfeatures), but the smoke universe is shipped scenarios + darwin._darwinpatches now attribute to[["darwin", nil]](was[]); base patches attribute darwin too. The build universe is unchanged — the darwin attribution matches no build row, so a darwin-only change still re-rolls no asset (spec-pinned)._release-line.yml— smoke legs withplatform: darwinrun onmacos-latest(arm64); the apt toolchain step is skipped there.lint-patches.yml— the same compile gate now also runs at change time:tools/smoke_matrixdiffed previous-release-tag..HEAD, so exactly the lines whose patch sets changed get legs (vacuously green when none did). Apply-clean is not compile-clean; a broken patch now fails on the PR, not at the release.Leg definitions added
tools/smoke_matrix v0.0.0-nexton this branch (diffs v0.2.38..HEAD — this branch touchespatches/3.4base patches, so the 3.4 tip gets every scenario):{ "include": [ { "line": "3.4", "version": "3.4.10", "platform": "linux-gnu" }, { "line": "3.4", "version": "3.4.10", "platform": "linux-musl" }, { "line": "3.4", "version": "3.4.10", "platform": "msys" }, { "line": "3.4", "version": "3.4.10", "platform": "darwin" } ] }The darwin leg runs as
runs-on: ${{ matrix.platform == 'darwin' && 'macos-latest' || 'ubuntu-latest' }}in both_release-line.yml(the release gate) andlint-patches.yml(the change-time gate).Evidence
Teeth proof (local, macOS arm64,
x86_64-w64-mingw32-gcc16.1.0): the msys leg now compiles_WIN32code for real. A deliberate#errorplanted in the#elif defined(_WIN32)branch ofpatches/3.4/process_c_tebako_spawn_msys.patch(applied cleanly —tools/lint 3.4.9OK) FAILS the leg:The break reverted, the same leg greens again (exit 0):
(An earlier attempt planted the break in the base
process_c_tebako_spawn.patchand the leg stayed green — correctly: the base patch is shadowed by its_msyssibling in the msys selection and never applies there. The break belongs to the msys variant, as above.)Fixed-state compiles (local):
compile.ois the prism path that errored in the repro above — green now.Before state (this branch's parent): the repro transcript at the top of this body (real cross gcc, unfixed patches — the #109 error, exit 1). With no
CCpinned at all, configure on a mingw-equipped host fails even earlier (crossobjdumpagainst host objects) — the old leg could only ever green by compiling a host tree.Regression gates:
bundle exec rspec— 121 examples, 0 failures (specs updated for the new darwin attribution and smoke universe, including a spec that the build plan still re-rolls nothing on a darwin-only change).tools/validate_manifests,tools/validate_msys_pairsgreen.tools/lintgreen for 3.4.5 / 3.4.9 / 3.4.10 (both prism patch variants apply cleanly).actionlintclean on both changed workflows. CI legs on this PR below.Closes #122
Closes #109