Skip to content

ci: cache-gated Python linker setup + Linux cross-compile release job (#50) - #51

Merged
zackees merged 4 commits into
mainfrom
feat/ci-soldr-linker-cache
Aug 7, 2026
Merged

zackees merged 4 commits into
mainfrom
feat/ci-soldr-linker-cache

Conversation

@zackees

@zackees zackees commented Aug 7, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #50.

Implements the CI improvements from #50, grounded in the current ci.yml (which had no build caching and re-downloaded every system linker on every run).

1. Cache-gated Python linker setup (ci/linker_setup.py)

The mold/wild release tarballs and the libtinfo5 .deb are the heavy, pinned downloads paid on every Linux run. They are now provisioned by a Python script that:

  • No-ops on a cache hit — if the artifacts are already present in the cache dir (restored by actions/cache), nothing is downloaded or extracted.
  • Downloads + SHA-256 verifies only on a miss, then materialises the binaries into the cache dir.
  • Fails loudly on a digest mismatch rather than serving a wrong linker.

ci.yml wraps the cache dir in actions/cache@v4 keyed on the pinned versions (MOLD_VERSION / WILD_VERSION / LIBTINFO5_VERSION). The clang-22 apt toolchain install and the existing version-drift smoke step are unchanged — the smoke step is the correctness gate on both hit and miss paths.

Validated in CI: the first run populated the cache (miss); the follow-up run restored it and Phase 1 / linux-gnu passed with the script no-op'ing on the hit — the miss→hit transition is confirmed across two consecutive Actions runs.

2. Cross-compile release on parallel Linux runners

New cross-release job builds reld in --release for x86_64-pc-windows-gnu on ubuntu-24.04 using the mingw-w64 cross toolchain, and uploads the artifact. This exploits cheap, plentiful Linux capacity for the compile+link phases. (The target already builds natively on the windows-gnu matrix leg, so the code is known-good for it.)

On soldr (deferred, with upstream issues filed)

#50 also called for adopting zackees/setup-soldr for build caching. Implementing it surfaced two real blockers in soldr's current cross-compile path, so soldr is not wired into this PR yet:

The proper fix is a first-class, published cross toolchain (soldr cc --target x86_64-linux-gnu.2.17, zig-style, with a glibc 2.17 floor) — filed as forge-ci/soldr#2335 (+ C++ side #1591). A companion glob-filtered side-cache request for setup-soldr is forge-ci/setup-soldr#463, and simplifying reld's linker cache onto it is tracked in #52. Once the published soldr toolchain lands, cross-release should switch to it and drop the mingw CC/CXX/AR wiring (see the job comment).

Tests

  • ci/tests/test_linker_setup.py — cache hit/miss logic, checksum verification, tarball member extraction (top-level + nested), GITHUB_PATH append.
  • ci/tests/test_ci_workflow.py — asserts the workflow wiring (cache step, script invocation, cross-release job).

pytest ci/tests green locally and in the Python CI job (31 tests).

🤖 Generated with Claude Code

Implements issue #50.

- ci/linker_setup.py: cache-gated provisioning of the Linux reference
  linkers (mold, wild) and the libtinfo5 runtime. No-op on a cache hit;
  download + SHA-256 verify only on a miss. A digest mismatch fails loudly.
- ci.yml: wrap the mold/wild/libtinfo5 downloads in actions/cache keyed on
  the pinned versions, and delegate the work to the Python script. The
  clang-22 apt toolchain install and the version-drift smoke gate are kept.
- ci.yml: new isolated cross-release job builds reld in --release for
  x86_64-pc-windows-gnu on a Linux runner (mingw-w64 linker) with
  zackees/setup-soldr providing content-addressed build caching.
- Tests: ci/tests/test_linker_setup.py (cache-hit/miss logic, checksum,
  tarball member extraction) and test_ci_workflow.py (workflow wiring).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
zackees and others added 2 commits August 7, 2026 07:55
The cross-release job failed to link reld for x86_64-pc-windows-gnu with
undefined references to ZSTD_* and blake3_* — the vendored C libraries
(zstd, blake3 SIMD) were built by the cc crate with the host compiler,
producing ELF objects the mingw PE/COFF linker ignores. Point the
target-scoped CC/CXX/AR at the mingw cross tools (and install g++-mingw)
so the C objects are built for the target and link cleanly.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Replace the 3-column table (small side-by-side thumbnails) with three
full-width, vertically stacked charts so each per-target benchmark image
is large and legible.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The soldr-driven cross build failed two ways: zccache built the cc-crate
C deps (zstd, blake3) with the host compiler (host ELF -> mingw PE link
failure, forge-ci/soldr#2334), and soldr's toolchain cache did not
rehydrate the target rust-std on a cache hit (E0463 can't find std).

Switch cross-release to the standard mingw-w64 path: dtolnay toolchain
with the target's rust-std, plus target-scoped mingw CC/CXX/AR/linker, and
plain cargo. Reliable and hack-free in the reld sense. Once a published
soldr cross toolchain exists (forge-ci/soldr#2335, `soldr cc --target ...`),
this job should switch to it and drop the mingw wiring.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@zackees zackees changed the title ci: cache-gated Python linker setup + soldr cross-compile release job (#50) ci: cache-gated Python linker setup + Linux cross-compile release job (#50) Aug 7, 2026
@zackees
zackees merged commit 244c801 into main Aug 7, 2026
13 checks passed
@zackees
zackees deleted the feat/ci-soldr-linker-cache branch August 7, 2026 15:23
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.

ci: adopt setup-soldr caching + cache-gated Python linker setup + cross-compile release builds on parallel Linux runners

1 participant