Skip to content

ci: extract the standard-config toolchain prologue into build-toolchain - #581

Merged
nebasuke merged 1 commit into
mainfrom
ci-build-toolchain-prologue
Jul 20, 2026
Merged

ci: extract the standard-config toolchain prologue into build-toolchain#581
nebasuke merged 1 commit into
mainfrom
ci-build-toolchain-prologue

Conversation

@nebasuke

@nebasuke nebasuke commented Jul 20, 2026

Copy link
Copy Markdown
Member

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.yaml gained a free-disk-space-macos prologue step; slang-tests.yaml never 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-toolchain composite encoding the standard prologue exactly once:

checkout-submodules → setup-sfw (optional) → prepare-msys (Windows) → free-disk-space-macos → build-llvm → build-solc

with llvm:/solc: toggles. Converted call sites:

Call site Config
test.yaml / cargo-checks solc: 'false'
test.yaml / build-and-test defaults
cache-warmup.yaml / warm-llvm solc: 'false'
cache-warmup.yaml / warm-solc llvm: 'false'
slang-tests.yaml solc: '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)

Not included

  • Specialty configs (sanitizer, coverage, integration, release) stay on direct build-llvm/build-solc calls: one-producer/one-consumer pairs with distinct params; folding them in would make the composite a switch bag.
  • The shared 5-leg matrix stays duplicated — composite actions can't carry a matrix, and a reusable workflow would drag job-level structure (container/volumes anchors, permissions, per-workflow cache config) into a shared file for little gain.

Relation to #553

Extracted from the cross-os-tester branch (#553), which will rebase onto this and add cross-os-tests.yaml as a sixth consumer. One deliberate difference: this version passes optional: '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

  • actionlint clean on all three touched workflows.
  • Cache-key-neutral by construction for LLVM/solc artifact caches and Swatinem caches (params unchanged, post-msys cache position preserved for build-and-test; cargo-checks is Linux-container-only so its key has no msys sensitivity).

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 with llvm/solc toggles.
  • Update test.yaml, slang-tests.yaml, and cache-warmup.yaml to use build-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.

Comment thread .github/actions/build-toolchain/action.yml
@github-actions

Copy link
Copy Markdown

Coverage Summary

Crate Line Coverage Function Coverage
solx 🟢 94.7% 🟡 68.0%
solx-benchmark-converter 🔴 0.0% 🔴 0.0%
solx-codegen-evm 🟢 88.9% 🟢 83.4%
solx-compiler-downloader 🔴 0.0% 🔴 0.0%
solx-core 🟢 96.6% 🟢 91.0%
solx-dev 🔴 2.4% 🔴 3.0%
solx-evm-assembly 🟡 70.6% 🟡 66.2%
solx-solc-test-adapter 🔴 1.7% 🔴 2.1%
solx-standard-json 🟢 95.4% 🟢 91.5%
solx-tester 🔴 38.2% 🔴 35.9%
solx-utils 🟢 83.8% 🟢 83.6%
solx-yul 🟡 78.9% 🟡 71.3%
Total 🟡 53.9% 🔴 47.0%

Codecov Report | HTML Report | Workflow Run

@nebasuke
nebasuke marked this pull request as ready for review July 20, 2026 19:04
@nebasuke
nebasuke requested a review from a team July 20, 2026 19:05
@nebasuke
nebasuke added this pull request to the merge queue Jul 20, 2026
Merged via the queue into main with commit f926fc9 Jul 20, 2026
46 checks passed
@nebasuke
nebasuke deleted the ci-build-toolchain-prologue branch July 20, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants