Repository navigation
build: retire ./_cargo trampolines; route Rust tooling through soldr (closes #76) - #78
Merged
Merged
Conversation
Closes #76. Companion to #75. Delete ./_cargo, ./_rustc, ./_rustfmt and route every caller through soldr cargo / soldr rustfmt etc. so the zccache compile cache is hit on every Rust build. The trampolines were useful before soldr existed; now they're noise that bypasses the cache (8-10 min cold builds vs. seconds on warm cache). Add a PreToolUse Bash hook (ci/hooks/tool_guard.py wired via .claude/settings.json) that blocks bare cargo / rustc / rustfmt / clippy-driver and the legacy ./_cargo invocations, with a clear message pointing at soldr. Pattern adapted from zackees/zccache. uv run <rust-tool> is rejected too because it bypasses soldr's toolchain selection. Callers updated to use 'soldr cargo' with a plain-cargo fallback (plus a "install soldr with: uv tool install soldr" hint): - ./lint - cargo fmt --check + cargo clippy - ./test - cargo test --workspace - ./install - cargo build --bin fastled when binstall missed - ./build-wheel - cargo build --release --bin fastled - .github/workflows/_build.yml - same path in CI CLAUDE.md updated to document the new rule and the hook. Tested locally: bash lint passes (soldr cargo fmt + soldr cargo clippy both hit the zccache). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The PreToolUse hook was rejecting gh pr create invocations whose heredoc body documented the hook's deny semantics with literal 'cargo build' text. Strip heredocs, command substitutions, and single/double-quoted strings before splitting the command into pipeline segments. Verified: 'cargo build' still denied; 'echo "cargo build"', 'cat <<EOF cargo build EOF', and 'soldr cargo build' all allowed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 of 3 tasks
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.
Summary
Closes #76. Companion to #75.
./_cargo,./_rustc,./_rustfmttrampolines and route every caller throughsoldr cargo/soldr rustfmt.ci/hooks/tool_guard.pywired via.claude/settings.json) that blocks barecargo/rustc/rustfmt/clippy-driverand the retired./_cargoinvocations — with a clear message pointing at soldr. Pattern adapted fromzackees/zccache's hook.uv run <rust-tool>is rejected too because it bypasses soldr's toolchain selection.CLAUDE.mdso coding agents (Claude + Codex viaCODEX.md's pointer) see the new rule.Why
The trampoline ended with
exec cargo "$@"— it set PATH andCARGO_BUILD_TARGETbut never routed through soldr. Local dev consequently bypassed the zccache compile cache that CI uses (viazackees/setup-soldr@v0). Cold builds offastled-pytook 8–10 minutes locally vs. seconds on warm cache. See #75 for the original root-cause investigation.Files
_cargo,_rustc,_rustfmtci/hooks/tool_guard.py,ci/hooks/README.md,.claude/settings.json./lint,./test,./install,./build-wheel,.github/workflows/_build.yml,CLAUDE.mdEach updated caller checks
command -v soldrand falls back to plain cargo with a "install soldr with: uv tool install soldr" hint so soldr-less environments still build (just slow).Hook behavior
soldr cargo …./_cargo …(retired)uv run <rust-tool>uv pip install …bash lint,ls -la, etc.A second commit (
fix(hook): ignore cargo references inside heredocs and quoted strings) hardens the parser so PR-body heredocs and shell-quoted strings that happen to contain the literal textcargo builddon't trigger false positives.Test plan
bash lint— green viasoldr cargo fmt+soldr cargo clippy(zccache log visible)bash testend-to-end on Linux/Windows/macOS (soldr provisioned viazackees/setup-soldr@v0, already in workflow)./installon a clean checkout with soldr installed — should fetch a binstallfastled-clior build viasoldr cargoRelated
ci/env.py::_apply_sccachewhich is sccache-named and not consumed by the script path; left for a follow-up.🤖 Generated with Claude Code