Skip to content

Route Rust toolchain trampolines through soldr - #31

Merged
zackees merged 1 commit into
mainfrom
feat/soldr-trampoline-migration
Apr 17, 2026
Merged

zackees merged 1 commit into
mainfrom
feat/soldr-trampoline-migration

Conversation

@zackees

@zackees zackees commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces zccache's hand-rolled PATH-munging trampolines with calls to soldr v0.7.0. soldr resolves each toolchain binary via `rustup which`, so the rustup-managed toolchain is always used without per-call environment shaping. Parallel to the FastLED/fbuild migration. Closes #30.

Nice closing of the loop: soldr already fetches and invokes zccache as its managed `RUSTC_WRAPPER`. Having zccache itself build through soldr closes the circle.

Changes

  • `ci/trampoline.py`: `cargo` / `rustc` / `rustfmt` / `clippy_driver` exec `soldr [--no-cache] ` instead of discovering `cargo_bin` and calling `ensure_windows_msvc` (soldr already enforces MSVC on Windows). `cargo` passes `--no-cache` so soldr's own RUSTC_WRAPPER / managed-zccache path is not inserted — prior bare-cargo semantics preserved. `_run_cargo_bin` (backing `run_zccache` / `run_zccache_daemon` / `run_zccache_fingerprint` / `check_on_stop`) also routes through soldr. `ci.env.activate()` is still called first so repo-local `.rustup` / `.cargo` layouts still win — soldr's `rustup which` honors those env vars.
  • `_cargo` / `_rustc` / `_rustfmt` bash shims: preserve the repo-local `RUSTUP_HOME` / `CARGO_HOME` detection (vendored toolchain support) and then `exec uv run soldr [--no-cache] `. The hand-rolled cargo_bin probe is removed.
  • `ci/hooks/tool_guard.py`: accepts `soldr ...` as a valid top-level invocation alongside `./_cargo` / `./_rustc` / `./_rustfmt`. `uv run cargo` remains blocked, but the message now points at either `./_cargo` or `soldr cargo`.
  • `pyproject.toml`: pulls `soldr>=0.7.0` as a dev dependency and bumps `requires-python` from 3.9 → 3.10 (soldr wheels require 3.10+).
  • Docs: `CLAUDE.md` and `CODEX.md` list `soldr ` as an approved form.

Verification

  • `uv sync` pulls `soldr 0.7.0` into the dev env
  • `./_cargo check --workspace --all-targets` — full 11-crate workspace passes in 1m08s
  • `uv run soldr --version` → `soldr 0.7.0`
  • `./_rustc --version` → `rustc 1.94.1` (correct rustup toolchain)
  • `./_cargo --version` → `cargo 1.94.1`
  • `tool_guard.check_command`:
    • blocks bare `cargo build` ✓
    • allows `./_cargo build` ✓
    • allows `soldr cargo build` ✓
    • allows `soldr --no-cache cargo build` ✓
    • allows `soldr rustc --version` ✓
    • still blocks `uv run cargo build` ✓ (with new error message pointing at `./_cargo` or `soldr cargo`)

Risk / rollback

Minimal — soldr's `rustup which` resolver mirrors what the hand-rolled trampolines already did. Revert is a one-commit rollback.

Closes #30

Replaces zccache's hand-rolled PATH-munging trampolines with calls to
soldr, which resolves each tool via \`rustup which\` so the
rustup-managed toolchain is always used without per-call environment
shaping. Parallel to FastLED/fbuild#54.

Nice closing of the loop: soldr already fetches and invokes zccache as
its managed RUSTC_WRAPPER. Having zccache itself build through soldr
closes the circle.

- \`ci/trampoline.py\`: cargo/rustc/rustfmt/clippy_driver exec \`soldr
  [--no-cache] <subcommand>\` instead of discovering cargo_bin and
  calling \`ensure_windows_msvc\`. soldr already enforces MSVC on
  Windows. \`cargo\` passes \`--no-cache\` so soldr's own
  RUSTC_WRAPPER / managed-zccache path is not inserted — prior
  bare-cargo semantics preserved. \`_run_cargo_bin\` (run_zccache,
  run_zccache_daemon, run_zccache_fingerprint, check_on_stop) also
  routes through soldr. \`ci.env.activate()\` is still called first so
  repo-local \`.rustup\` / \`.cargo\` layouts still win — soldr's
  \`rustup which\` honors those env vars.
- \`_cargo\` / \`_rustc\` / \`_rustfmt\`: bash trampolines preserve the
  repo-local RUSTUP_HOME / CARGO_HOME detection (so vendored toolchain
  layouts still override the user-global location) and then
  \`exec uv run soldr [--no-cache] <subcommand>\`. The hand-rolled
  cargo_bin probe is removed.
- \`ci/hooks/tool_guard.py\`: accepts \`soldr ...\` as a valid
  top-level invocation alongside the \`./_cargo\` / \`./_rustc\` /
  \`./_rustfmt\` trampolines. \`uv run cargo\` remains blocked, but the
  message now points at either \`./_cargo\` or \`soldr cargo\`.
- \`pyproject.toml\`: pulls \`soldr>=0.7.0\` as a dev dependency and
  bumps \`requires-python\` from 3.9 to 3.10 (soldr wheels require
  3.10+).
- Docs: \`CLAUDE.md\` and \`CODEX.md\` list \`soldr <tool>\` as an
  approved form and explain the \`--no-cache\` preservation of
  previous semantics.

Closes #30

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@codecov

codecov Bot commented Apr 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Replace Rust toolchain trampolines with soldr

1 participant