Repository navigation
Description
Updated 2026-08-07 — reframed as adoption. After auditing soldr / setup-soldr / soldr-toolchain / forge, the cross-compile capability already exists and ships (
soldr build --target, bundled zig + xwin, catalogue toolchains at a glibc-2.17 floor, provisioned bysetup-soldrcross-targets). reld's blockers came from using thesoldr cargo buildpassthrough, not the native front door. Nothing upstream needs to be built for this goal. See the detailed update comment. Original proposal preserved below.
Context
Scarce CI runners (windows-2022, macos-14) currently pay for the full compile + link + build of the OS-specific product on-target:
ci.yml→phase1-nativebuilds--all-targetsand runs the whole test suite natively on windows-msvc, windows-gnu, and macos-arm64.- The
reld-benchsmoke steps inci.ymlbuildreld-bench--releaseon the native windows/macos runners before benchmarking. - Windows/macOS minutes are the scarce, expensive, queue-prone capacity; Linux (
ubuntu-24.04) is cheap and plentiful.
We already have two proofs that the "compile elsewhere, run here" split works in this repo:
.github/workflows/linker-artifacts.ymldemonstrates the exact build → host handoff shape we want to generalize: a per-targetbuildjob useszackees/setup-soldr@mainwithcross-targets+soldr cargo build --locked --release, uploads the binary as an artifact, and a separatehostjob just downloads it and smoke-runs it (--version) on the native runner. No compilation on the native leg..github/workflows/benchmark-assets.ymlalready froze the corpus build so the benchmark loop does zero compilation in the loop. This issue is the analogous move for the linker binary itself: cross-build it once on Linux, then the native runner does zero compilation before benchmarking.
soldr cook (the dependency prebuild/warmup) and setup-soldr's layered content-addressed cache (the zccache store) are the mechanism. This repo has a large existing cache budget, so it's a good real-world test case for how well setup-soldr's caching actually holds up under a heavy, multi-target workload.
Proposal
Generalize the linker-artifacts.yml build→host split to CI and the benchmarks:
- Cross-build on Linux. Add/extend jobs that cross-compile the release product (
reld/reld-link) forx86_64-pc-windows-msvc,x86_64-pc-windows-gnu, andaarch64-apple-darwinonubuntu-24.04runners viazackees/setup-soldr@main:cross-targets: <triple>,--release.prebuild-deps: soldr-cookto warm dependencies viasoldr cookbefore the workspace's ownsoldr cargo build.cache: truewith the per-layer toggles (build-cache,target-cache,cargo-registry-cache) enabled so we lean on the repo's cache budget.- Upload the finished binary as an artifact.
- Native leg = download + run only. The
windows-*/macos-*legs stop compiling the product. They download the cross-built artifact and:- run the on-target tests/smoke that only need the shipped binary (see Open questions for the test-harness split), and
- run
reld-benchagainst the prebuilt binary + a frozen corpus (the cleanest first candidate —reld-benchneeds only the binary and a corpus, no source tree).
- Measure the caching. Capture setup-soldr's cache outputs as the success signal:
cache-hit,build-cache-hit,target-cache-hit, and especiallycompile-cache-hits/compile-cache-misses/compile-cache-hit-rate, plus wall-clock deltas vs. the current native-build path. Surface them in the job summary.
Dependency on upstream soldr (why this can't fully land today)
The existing cross-release job in ci.yml (currently only x86_64-pc-windows-gnu) deliberately does not use soldr cargo and hand-wires mingw-w64 instead. Its inline NOTE documents the two blockers this issue depends on:
- cross/release compile: use correct target C toolchain + glibc 2.17 floor (Linux -> windows-gnu fails; Linux builds tie to runner glibc) soldr#2334 —
zccachebuilds the cc-crate C deps (zstd,blake3) with the host compiler, so host ELF objects fail the cross (mingw PE) link. - feat: 'soldr cc --target x86_64-linux-gnu.2.17' zig-style cross compiler + published soldr-toolchain (build tools ourselves, no CC hacks) soldr#2335 — the toolchain cache does not rehydrate the target's
rust-stdon a cache hit →E0463 can't find crate for std; needs a publishedsoldr cc --target ...cross toolchain.
Once those land, the cross-release job (and the new legs above) should switch to soldr + soldr cc --target and drop the manual mingw CC/CXX/AR wiring. This issue tracks the reld-side rollout; #2334 / #2335 are the upstream prerequisites.
Acceptance criteria
- At least the benchmark path (windows-msvc + macos-arm64) runs
reld-benchagainst a cross-built-on-Linux release binary, with zero product compilation on the native runner. - Cross-build jobs use
zackees/setup-soldr@mainwithprebuild-deps: soldr-cookandcache: true, and the job summary reports setup-soldr's cache-hit /compile-cache-hit-rateoutputs. - A recorded wall-clock comparison (native-build vs. cross-build + ship) demonstrating the scarce-runner time reduction, captured in the PR description or job summary.
- The
cross-releaseNOTE inci.ymlis updated to point at this issue and the current state of #2334 / #2335; when those are resolved, the job switches tosoldr cc --targetand drops the manual mingw wiring. - No loss of coverage: any on-target test that genuinely needs the source tree /
cargo testharness (see Open questions) is either preserved on the native leg or explicitly documented as out of scope for the artifact-only path.
Decisions
- Scope this as staged, benchmarks first.
reld-benchonly needs the binary + a corpus, so it's the lowest-risk first cut; acceptance-test offloading is a follow-up. Rationale: it delivers the scarce-runner savings immediately without waiting to untangle the cargo-test harness dependency. - Depend on, not duplicate, the upstream soldr fixes. Rather than re-solving the host-compiler / rust-std cache problems in reld's CI, this tracks #2334 / #2335 and flips to
soldr cc --targetonce published. Rationale: thecross-releaseNOTE already committed to that plan. - Priority P2. A CI cost/speed optimization, not a correctness or shipping blocker. Upgrade if scarce-runner queueing becomes a merge bottleneck.
- Treat this as the setup-soldr caching test case. The goal explicitly wants to validate setup-soldr under heavy caching, so emitting the cache-hit metrics is a first-class deliverable, not incidental.
Open questions
- Test-harness split: which native tests can run against only the shipped binary vs. which need the source tree +
cargo test(e.g. the acceptance / external / difftest suites inphase1-nativeall invokecargo test)? Those still need a source checkout on-platform even if the product is prebuilt — so the win for them is narrower (skip the product build, still run tests). Benchmarks are the clean artifact-only case; the acceptance suite needs a decision on whether to prebuild +cargo test --no-build-style reuse or keep compiling. - msvc from Linux: does the setup-soldr /
soldr cc --target x86_64-pc-windows-msvcpath cover the MSVC ABI (link.exe/lld-link, import libs) from a Linux host, or is windows-gnu the only cross target that's realistic until msvc cross tooling exists? This bounds how much of the windows leg can actually move off-runner. - Corpus availability per target: the benchmark path needs a frozen corpus for each target on the native runner (see bench: frozen Bevy link corpus — compile once per platform, replay the link every iteration #55 / meta: frozen linker-object benchmark assets — benchmark-assets branch(es) + manifest.json (compile once, link every iteration) #57 benchmark-assets work) — confirm the manifest covers windows-msvc + macos-arm64.
Related issues
- ci: simplify system-linker cache via setup-soldr glob-filtered side cache #52 — ci: simplify system-linker cache via setup-soldr glob-filtered side cache — same component (setup-soldr caching in CI); coordinate the cache-layer strategy with this.
- Bridge linkers: run + benchmark reld on Windows and macOS now by delegating to lld (rust-lld) per platform #17 — Bridge linkers: run + benchmark reld on Windows and macOS now by delegating to lld — adjacent (how reld links on those platforms); this issue is about where the product is built, not how it links.
Activity
zackees commentedon Aug 7, 2026
Update — soldr already ships the cross-compile front door; this is an adoption, not a build-it-ourselves
I dug through
zackees/soldr,zackees/setup-soldr,zackees/soldr-toolchain, andzackees/forge. The premise this issue (and thecross-releaseNOTE inci.yml) was written under — "soldr's cross path is broken, so we hand-wire mingw/llvm" — is specific to thesoldr cargo buildpassthrough. The native front door already does everything we want, with zero compiler tools to install on the runner.What already exists upstream (verified in the source)
soldr —
soldr build --target <triple|alias>is a native cross front door that "owns compiler, linker, SDK, sysroot, environment, and capability selection" (verbatim fromsetup-soldr/action.ymlcross-targetsdoc). Under the hood:crates/soldr-cli/src/cargo_front_door/zig_shim.rs— bundled zig cc/cxx/ar/ranlib wrappers per target:x86_64/aarch64-unknown-linux-gnu,*-linux-musl,x86_64-pc-windows-gnu,x86_64/aarch64-apple-darwin(with catalogue Apple SDK handling). This is the "no CC_/CXX_/AR_ hacks" path — the wrappers are the target C toolchain, andcc-built deps (zstd, blake3) build for the target, not the host.crates/soldr-cli/src/cargo_front_door/clang_cl_shim.rs— MSVC cross viasoldr cargo xwin build --target *-pc-windows-msvc(xwin + aclang --driver-mode=clshim). Explicit charter comment: "they just typesoldr cargo xwin build --target ...and it works on a stock device with no dependencies."crates/soldr-cli/src/target_alias.rs— target aliases (win-x64,mac-arm64,linux-x64-musl, …) + a glibc-floor selector (x86_64-unknown-linux-gnu.2.17), baseline 2.17 for the two gnu-linux targets — i.e. the.2.17mechanism #2335 proposed is already implemented forsoldr build.soldr-toolchain — the catalogue already carries every sysroot/toolchain these paths consume:
mingw-w64-gcc-windows-x64-gnu,gnu-linux-toolchain-*(glibc-floored),musl-linux-toolchain-*,apple-sdk-thin-*,xwin-cache-*, and an MSVC bundle viaexternal-entries.v1.json.forge — builds those recipes on native GHA runners with a hard glibc-2.17 floor ("Every Linux
-gnurecipe MUST build against glibc 2.17"), feeding soldr-toolchain → the soldr release archive.setup-soldr —
cross-targets: <triple>runssoldr preparefor that target and exports the compiler/linker/SDK/sysroot/env plan; the build step is justsoldr build --target <triple>. Noapt-get install gcc-mingw, nochoco install llvm, nobrew install llvm@18.Consequence for reld
The
cross-releaseNOTE's two blockers (soldr#2334 host-compiler C deps, soldr#2335 rust-std cache) were hit onsoldr cargo build --target …— the bare passthrough, which deliberately does not cross-route. Switching tosoldr build --target …(orsoldr cargo zigbuild/soldr cargo xwin build) sidesteps both, because that path provisions and wires the target toolchain itself.Revised plan for this issue (adoption)
cross-releasejob → dropapt-get install gcc-mingw-w64+ the manualCC_/CXX_/AR_/LINKERenv. Usezackees/setup-soldr@mainwithcross-targets: x86_64-pc-windows-gnuand build withsoldr build --target x86_64-pc-windows-gnu -p reld --bin reld. Extend the matrix toaarch64-apple-darwinandx86_64-pc-windows-msvc(the latter viasoldr cargo xwin build) so every OS product is cross-built on ubuntu.windows-2022/macos-14jobs stop compiling the product: download the cross-built artifact, then run the on-target tests/smoke that need only the binary, and runreld-benchagainst the prebuilt binary + a frozen corpus (cleanest first candidate).phase1-nativelinux leg can also move tosoldr buildfor a glibc-2.17-floored release artifact if we want a portable Linux binary; the reference-linker install stays (that's test fixtures, not the product toolchain).cache: true+prebuild-deps: soldr-cookand surface setup-soldr'scompile-cache-hit-rate/*-cache-hitoutputs in the job summary — this is our real-world stress test of setup-soldr caching across a 3-target cross matrix.Genuine remaining upstream gaps (narrow — filed/annotated separately, not blockers here)
soldr cargo build --target(bare passthrough) still doesn't auto-route C deps — soldr#2334. Not needed by reld once we usesoldr build --target; worth fixing upstream for ergonomics or documentingsoldr buildas the front door.soldr cc --targetverb — soldr#2335. The wrappers exist internally (zig_shim); exposing them as a top-level command is a nice-to-have reld doesn't require.soldr build --targetglibc floor is baseline-2.17 only forx86_64/aarch64-unknown-linux-gnu; other floors error out and point atcargo-zigbuild(soldr#1060 / soldr#2139).Net: nothing in soldr/setup-soldr/soldr-toolchain/forge needs to be built for reld to hit this issue's goal — the cross toolchains are already ours, already published, already fetched on demand. The work is reld adopting
soldr build --targetand deleting the hand-installed toolchain steps. I'll open a draft PR wiring this and link it here; it needs a live CI run to validate the three cross legs end-to-end.zackees commentedon Aug 7, 2026
Correction — blessed cross targets are MSVC + Apple/Linux, not windows-gnu
soldr's canonical target set (
soldr/ci/canonical-targets.json) blesses MSVC for Windows —x86_64-pc-windows-msvc(win-x64) andaarch64-pc-windows-msvc(win-arm64) — with"ci":{"kind":"cross"}, plusx86_64/aarch64-apple-darwinand the linux gnu/musl set. There is nox86_64-pc-windows-gnuin the canonical set: soldr's design rule is "MSVC on Windows always," and windows-gnu is built on a Windows host with the managed MinGW-w64 bundle, not cross-from-Linux (examples/docker-cross-win/README.md).Consequences for the plan above:
reld's existing
cross-releasejob targetsx86_64-pc-windows-gnu— the wrong triple to move onto the blessedsoldr build --targetcross-from-Linux path. The scarce runners reld actually benchmarks/tests on are windows-msvc (phase1-nativemsvc leg +reld-benchwindows-msvc + msvc self-host) and macos-arm64.So the cross-from-ubuntu matrix should be
x86_64-pc-windows-msvcandaarch64-apple-darwin. Exact invocation, straight from soldr's owncross-compile-all-targets.yml(all targets from linux-x86 runners):soldr's cargo front door auto-injects the xwin
CC_/CXX_/AR_/LD_<triple>for the msvc lanes (prepare_xwin_env/compute_subcommand_env_overridesincargo_front_door/mod.rs) — no workflow-levelCC_<triple>=clang-clhedge, and the darwin lane injects the Apple SDK env internally.Keep windows-gnu on a native Windows runner if it must be covered at all (it's secondary for reld); don't try to cross it from Linux.
I'm opening a draft PR that adds an additive
cross-shipworkflow (build msvc + darwin release binaries on ubuntu viasetup-soldr+soldr build --target, upload, then a native leg downloads + smoke-runs the artifact) so it can be iterated against a live CI run without touching the existing green jobs. Linking it here.zackees commentedon Aug 7, 2026
Draft implementation opened: #61 — additive
cross-ship.ymlthat cross-builds reld for windows-msvc + macos-arm64 on ubuntu viasoldr build --target(zero toolchain installs) and smoke-runs the shipped binary on the native runner. Needs a live CI run to validate the two cross legs; it doesn't touch the existing green jobs. Once green, migratecross-release+ the nativereld-benchbuild steps onto it.zackees commentedon Aug 7, 2026
✅ Proven in CI — cross-compile works with zero toolchain installs
The
cross-shipworkflow (PR #61) ran green end-to-end on a live GHA run (run 31196543127):soldr build --target x86_64-pc-windows-msvcon ubuntu, no compiler tools installedsoldr build --target aarch64-apple-darwinon ubuntureld.exe;--versionprintedReld; zero compilation on-targetThis settles the "fix missing cross-compile functionality upstream" branch of the plan: nothing is missing — soldr cross-built both foreign targets from Linux with no
apt/choco/brewtoolchain installs, exactly as intended. The scarce Windows/macOS runners did only download + run (6–7s).setup-soldr caching findings (the "how well does it work" test case)
Run #1 was a cold cache (0 hits / 148–177 compile-cache misses — expected on first run). The workflow annotations surfaced three real, actionable signals:
soldr cookreuse = 0 — annotation: "cook ran withprebuild-deps-flags='--release'… cargo check/clippy/doc/test compile in the dev (debug) profile → different cache key." On a cold run this is partly just an empty cache, but the profile-key mismatch is worth confirming against the warm run.zccache/daemon-state/embedded-v1/.../artifacts/.staged-v2/**blobs (14–20 MB each). Candidate for payload trimming / excluding daemon-state from the saved layer.SOLDR_LINKER=fastdefault + a "pre-populated shared target dir → possible.rmetaerror" known-limitation notice.I've kicked a warm rerun to measure the actual compile-cache hit-rate and wall-clock delta; posting those numbers next. That warm-cache hit-rate is the concrete metric for "how well setup-soldr caching works on this repo's heavy cache."
zackees commentedon Aug 7, 2026
📊 Warm-cache result — setup-soldr caching measured
Reran the same workflow with the cache populated (run 31196543127, attempt 2):
Compile-cache on the warm run (windows-msvc job log):
100% compile-cache hit rate, vs. 0/148 on the cold run. This is the concrete "how well does setup-soldr caching work" answer for this repo: with a warm cache the cross-build is fully served from cache and ~4× faster. It also explains the cold-run
soldr cook"0 reuse" annotation — that was cold-cache noise;build-cachecarries the work across runs and the second run hit everything.Verdict on the goal
soldr build --target, no compiler tools installed, shipped to native runners that only download + run (6–8s, zero on-target compilation).Small tuning follow-ups (non-blocking, tracked here)
zccache/daemon-state/.../.staged-v2/**— consider trimming the saved layer.errors=3in the zccache session (build still succeeded) — worth a glance upstream.ci.yml'scross-release(windows-gnu) + the nativereld-benchbuild steps onto this pattern, and extend the macOS/Windows host leg from a smoke-run to a realreld-bench --replay-corpusagainst a frozen corpus (meta: frozen linker-object benchmark assets — benchmark-assets branch(es) + manifest.json (compile once, link every iteration) #57).ci: add cross-ship workflow (build off-platform via soldr, run on-pla…
feat(recipe): host-neutral mingw-w64-sysroot for win-gnu cross builds (…
zackees commentedon Aug 7, 2026
Cross-repo follow-up (windows-gnu-from-Linux): the missing host-neutral mingw sysroot is now built + published in soldr-toolchain — zackees/soldr-toolchain#114 (recipe #115, catalogue asset via #116), forge-validated (run 31198742022), zero host executables. This is what a Linux-hosted
x86_64-pc-windows-gnulink needs. The consumer side (soldr fetching it from a non-Windows host) is forge-ci/soldr#2336. Once that lands, reld'scross-releasewindows-gnu leg can drop its hand-installed mingw and move onto the blessedsoldr build --targetpath like the msvc/darwin legs already did in #61.feat(recipe): Linux-hosted mingw-w64 cross gcc toolchain (#114 Phase …
zackees commentedon Aug 7, 2026
win-gnu-from-Linux chain: producer done + published. The Linux-hosted mingw cross gcc toolchain is built + published (soldr-toolchain#114 Phase 2, PE-link-proven — links an x86-64 PE from Linux). soldr consumer building blocks are in soldr#2341; the final host-gate flip is soldr#2342. Once that lands, reld's
cross-releasewin-gnu leg drops the aptgcc-mingw-w64install and moves ontosoldr build --target x86_64-pc-windows-gnu(like the msvc/darwin legs already did in #61).feat(win-gnu): enable Linux-hosted win-gnu cross builds (#2336) (#2341)
ci(cross-ship): add windows-gnu leg via soldr build --target (no apt …
ci(cross-ship): add windows-gnu leg via soldr build --target (no apt …
ci(cross-ship): add windows-gnu leg via soldr build --target (no apt …
ci(cross-ship): add windows-gnu leg via soldr build --target (no apt …
ci(cross-ship): add windows-gnu leg via soldr build --target (no apt …
ci(cross-ship): add windows-gnu leg via soldr build --target (no apt …
ci(cross-ship): add windows-gnu leg via soldr build --target (no apt …
ci(cross-ship): add windows-gnu leg via soldr build --target (no apt …
ci(cross-ship): add windows-gnu leg via soldr build --target (no apt …
ci(cross-ship): windows-gnu via soldr build --target, no apt mingw (c…
zackees commentedon Sep 17, 2026
The draft is validated
cross-ship.ymlcarries a NOTE saying it is a draft that "must be validated against a live CI run before the cross legs inci.yml(cross-release + the native reld-bench build steps) are migrated onto it." I dispatched that run againstmainas part of the #153 burn-down: run 35276124820, all six jobs green.Three targets cross-built on ubuntu through the blessed soldr front door with no toolchain installed on the runner, shipped as artifacts, and run on the native runners with no compilation there. That is this issue's mechanism, working, on
main.So the precondition written into the workflow is met and the migration is unblocked. What remains is the migration itself, which is the part that can break green CI and therefore wants its own PR per leg rather than one sweep:
ci.yml'scross-releasejob onto the cross-ship shape (it currently hand-wires mingw-w64 and deliberately avoidssoldr cargo).reld-benchrelease builds that currently run on the windows and macos runners — the cleanest candidate, sincereld-benchneeds only the binary and a frozen corpus.phase1-nativecompile phase, which is Pilot: cross-compile the phase1 build from Linux to free Windows/macOS runners #130's pilot and the hardest of the three, because the payload is test binaries plus fixtures rather than one executable.I have not started any of those: each needs a live CI run to prove it, and doing them in one pass would make a failure ambiguous. Also worth deciding before step 3 — see my comment on #130 — whether that issue collapses into this one.
zackees commentedon Sep 18, 2026
All three sub-issues are merged and validated live on
main:ci.yml'scross-releasenow gets mingw-w64 from the soldr catalogue (SHA-256 verified, noapt-get). CI run 35293898256 is green on all 8 jobs.cross-ship.ymlis no longer a draft and now reports setup-soldr cache metrics from real outputs. Run 35293899946 is green on all six jobs.The same cross builds also ran locally with the workflows' own commands: windows-gnu → PE, windows-msvc → PE, aarch64-darwin → Mach-O 64.
Still open under this issue: moving the
phase1-nativecompile phase off the native runners. That work is #130, and it's harder, because the payload is test binaries plus fixtures rather than a single executable. I'm leaving this issue open for it unless you'd rather close #130 into it.zackees commentedon Sep 18, 2026
Closing: all three migration legs are merged and verified on a live run (#167, #168, #169; follow-up #173). The one remaining piece, moving the
phase1-nativecompile phase off the native runners, is tracked in #130 so it has one home.