ci: extract the standard-config toolchain prologue into build-toolchain - #581
Merged
Conversation
The submodules → SFW → msys → macOS-disk → LLVM → solc prologue existed in five near-identical copies (test.yaml cargo-checks and build-and-test, cache-warmup warm-llvm and warm-solc, slang-tests). Their LLVM/solc build params define the standard-config cache keys, so any drift between copies is a silent cache miss — and step-level drift is just as real: slang-tests never picked up free-disk-space-macos, so its macOS legs died with ENOSPC whenever the runner image shipped tight on space (run 29762518487: the arm64 leg hit `ld: write() failed, errno=28` at 98% disk). The new build-toolchain composite action encodes the prologue exactly once; call sites only choose which tools to build (llvm/solc toggles). The composite also absorbs the libstdc++ workaround from #550 (fix option 2), applying it to every standard-config Windows consumer: the bundled static libstdc++.a is dropped from the restored LLVM tree, so test builds link libstdc++ shared. This defuses the landmine #550 documents for test.yaml — its Windows leg was green only while the cargo cache kept llvm-sys Fresh, one fingerprint change away from an unlinkable fresh compile. The drop runs after build-llvm's mid-action cache save, so the shared cached tree keeps the archive; release binaries keep static linking (release.yaml builds LLVM itself and does not use this action). The rust-cache steps move after the composite rather than before it: prepare-msys (now inside the composite) switches the rustup host, which is part of the Swatinem cache key, so only the post-msys position keeps hitting the caches already saved on main. The late restore costs nothing on artifact-cache hits — build-llvm/build-solc skip their internal solx-dev builds entirely. Other consequences of the consolidation: - slang-tests' and cache-warmup's macOS legs now run free-disk-space-macos — previously missing exactly where the coldest LLVM builds happen. - cache-warmup's warm jobs ran msys before SFW; they now get test.yaml's proven SFW-first order. - warm-solc's explicit boost-version '1.83.0' dropped (it is the build-solc default, so the solc cache key is unchanged). - the inline submodule-checkout scripts are replaced by the existing checkout-submodules action (same update, plus --init). The specialty configs (sanitizer, coverage, integration, release) stay on direct build-llvm/build-solc calls: each is a one-producer/one-consumer pair with distinct params, and folding them in would turn the composite into a switch bag. Extracted from the cross-os-tester branch (#553), which will rebase onto this and add its cross-os-tests.yaml as a consumer. One deliberate difference from the #553 version: the composite passes optional: 'true' to setup-sfw, preserving what every current call site does — setup-sfw defaults to mandatory, and making a socket.dev outage fail all five jobs is not a change this extraction should smuggle in.
There was a problem hiding this comment.
Pull request overview
This PR reduces CI workflow drift by extracting the shared “standard toolchain prologue” (submodule init + optional Socket Firewall + platform prep + disk cleanup on macOS + standard LLVM/solc builds) into a single composite action, and then reusing it across the main test, slang test, and cache warmup workflows. This centralizes the standard-config cache-key-defining build parameters and ensures macOS Slang legs also run the disk cleanup step that previously drifted out.
Changes:
- Introduce a new composite action (
build-toolchain) that encodes the standard CI toolchain prologue withllvm/solctoggles. - Update
test.yaml,slang-tests.yaml, andcache-warmup.yamlto usebuild-toolchain, aligning macOS disk cleanup and Windows MSYS prep across consumers. - Standardize cache behavior by consolidating the LLVM/solc build parameter source of truth in the shared action.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/test.yaml |
Replaces duplicated prologue steps with build-toolchain, and positions rust-cache after toolchain setup. |
.github/workflows/slang-tests.yaml |
Switches to build-toolchain (LLVM only) while continuing to build a separate Release solc for lit tests. |
.github/workflows/cache-warmup.yaml |
Uses build-toolchain for warm-LLVM and warm-solc jobs to keep standard-config warming consistent. |
.github/actions/build-toolchain/action.yml |
Adds the new shared composite action implementing the standard CI prologue and standard LLVM/solc build parameters. |
Coverage Summary
|
nebasuke
marked this pull request as ready for review
July 20, 2026 19:04
hedgar2017
approved these changes
Jul 20, 2026
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.
Share more of the toolchain between Tests and Slang tests, and fix the Free disk space (macOS) mixing for Slang while we're at it.
Claude summary
Why now
Run 29762518487 (Slang Tests on #554, macOS arm64) failed with
ld: write() failed, errno=28— ENOSPC at 98% disk during the test-binary link.test.yamlgained afree-disk-space-macosprologue step;slang-tests.yamlnever did. That's the drift class this PR removes: the same six-step prologue existed in five near-identical copies, and each new prologue step had to be added five times.What
New
.github/actions/build-toolchaincomposite encoding the standard prologue exactly once:with
llvm:/solc:toggles. Converted call sites:test.yaml/ cargo-checkssolc: 'false'test.yaml/ build-and-testcache-warmup.yaml/ warm-llvmsolc: 'false'cache-warmup.yaml/ warm-solcllvm: 'false'slang-tests.yamlsolc: 'false'(keeps its own Release+MLIR solc build for the lit tests)The LLVM/solc build params in the composite define the standard-config cache keys — drift between copies was a silent cache miss; now changing them re-keys all consumers together.
Behavior changes (all deliberate)
free-disk-space-macos— previously missing exactly where the coldest LLVM builds happen. Fixes the fix(tester): resolve the Slang deploy target in source order #554 failure mode.libstdc++.ais dropped from the restored LLVM tree (after build-llvm's mid-action cache save, so the cached tree keeps it). Defuses the landmine documented in Windows: fresh llvm-sys builds cannot link against the bundled static libstdc++.a under MSYS2 GCC 16 — CI is one cache-fingerprint change from breaking #550 for test.yaml's Windows leg, which was green only while the cargo cache kept llvm-sys Fresh. Release binaries keep static linking (release.yaml doesn't use this action).boost-version: '1.83.0'— it's the build-solc default; solc cache key unchanged.checkout-submodulesaction (same update, plus--init).Not included
Relation to #553
Extracted from the cross-os-tester branch (#553), which will rebase onto this and add
cross-os-tests.yamlas a sixth consumer. One deliberate difference: this version passesoptional: 'true'to setup-sfw, preserving what every current call site does. The #553 copy omits it, and setup-sfw defaults to mandatory — that would make a socket.dev outage fail all five jobs, a change the extraction shouldn't smuggle in (worth a look on #553 whether that was intended).Validation