Repository navigation
ci: cache Rust builds with mbx (mr-boxington) - #135
Conversation
Pin the mr-boxington CLI in mise.toml and document running Cargo through mbx. The mr_boxington Rust option is not used because a rust entry needs a version, which would override rust-toolchain.toml. Intel macOS has no prebuilt mbx, so mise.macos-x64.toml builds it with the cargo backend.
Run clippy, tests and llvm-cov through mbx in the Rust and Sonar workflows, installing the pinned toolchain before the cache action so the key hashes the right rustc. Each job gets its own cache generation. codspeed and release workflows are unchanged.
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Code Review
This pull request integrates the "mbx" (mr boxington) Cargo build cache into the project's development workflow using "mise", updating "CONTRIBUTING.md" and "mise.toml" accordingly. However, the proposed configuration for Intel macOS has several issues: ".miserc.toml" is not a recognized configuration file, "auto_env = true" does not load platform-specific files as expected, and "[tool_alias]" is an invalid section in "mise.macos-x64.toml". It is recommended to remove these files and update the documentation to guide Intel macOS users to install "mbx" via "cargo install" or configure it locally in "mise.local.toml" under the "[plugins]" section.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Merging this PR will not alter performance1 warning
Comparing |
[Medium impact] The PR appears safe to merge; no actionable new issues were found. SummaryAdds
No actionable new issues were found. Reviews (2) · Last reviewed commit: "chore: apply AI code review suggestions" · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 6 files
Architecture diagram
sequenceDiagram
participant GH as GitHub Actions
participant Job as CI Job (build/ignored-tests/coverage)
participant Rustup as rustup
participant MBX as mbx (mr-boxington)
participant Cache as GitHub Actions Cache
participant Cargo as cargo/clippy/llvm-cov
Note over GH,Cargo: CI Rust Build Cache Flow (rust.yml, sonar.yml)
GH->>Job: Start job
Job->>Rustup: rustup show active-toolchain || rustup toolchain install
Rustup-->>Job: Toolchain ready (per rust-toolchain.toml)
Job->>MBX: jdx/mr-boxington-action@v1.7.3
MBX->>MBX: Key hash: rustc + cache-generation (per-job)
MBX->>Cache: Query for existing cache
alt Cache hit
Cache-->>MBX: Restore cached build artifacts
MBX-->>Job: Ready with cached artifacts
else Cache miss
Cache-->>MBX: No cache found
MBX-->>Job: Ready for cold build
end
Note over Job,Cargo: Build Commands Through mbx
Job->>MBX: mbx clippy (build job)
MBX->>Cargo: Invoke cargo clippy with cache wrapper
Cargo-->>MBX: Clippy results
MBX-->>Job: Check complete
Job->>MBX: mbx test (build/ignored-tests jobs)
MBX->>Cargo: Invoke cargo test with cache wrapper
Cargo-->>MBX: Test results
MBX-->>Job: Test complete
Job->>MBX: mbx llvm-cov (coverage job)
MBX->>Cargo: Invoke cargo llvm-cov with cache wrapper
Cargo-->>MBX: Coverage output
MBX-->>Job: Coverate complete
MBX->>Cache: Store updated artifacts
Cache-->>MBX: Store confirmed
Note over Job: CARGO_INCREMENTAL=0 set in all cached jobs
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Run every mbx example in CONTRIBUTING through mise exec, skip mr-boxington in the JS-only CI job, and install the pinned toolchain explicitly in the Sonar job.
|
/gemini review |
|
There was a problem hiding this comment.
Code Review
This pull request introduces mbx (mr boxington) as a shared Cargo build cache to speed up local builds, updating CONTRIBUTING.md and pinning the tool in mise.toml. However, the proposed approach for Intel macOS compatibility using .miserc.toml and mise.macos-x64.toml is unsupported by mise and will cause installation failures on those platforms. It is recommended to remove these separate configuration files and instead use mise's built-in Tera templating in mise.toml to conditionally install cargo:mbx on Intel macOS, updating the documentation accordingly.



Summary
Mirrors pleaseai/shunt#894.
rust.yml(build and ignored-tests jobs) andsonar.yml(coverage) had no Rust build cache. Each job now installs the toolchain pinned inrust-toolchain.toml, thenjdx/mr-boxington-actionv1.7.3 (SHA-pinned, mbx 1.29.2, default GitHub cache backend, per-jobcache-generation), and runs clippy, test, and llvm-cov throughmbx.What changed
rust.ymlandsonar.ymlrun clippy/test/llvm-cov throughmbx.cargo fmtis unchanged.mise.tomlpinsmr-boxington = "1.29.2". Intel macOS builds it from crates.io viamise.macos-x64.tomland the.miserc.tomlauto_env, because there is no darwin/x86_64 release archive.CONTRIBUTING.mddocumentsmbx build/mbx testfor local use.Scope
The codspeed and release workflows are untouched; release builds stay off build caches.
Tradeoffs
mr_boxingtonrust-tool option is not used. Arustentry requires a version (verified on mise 2026.11.1), which would overriderust-toolchain.toml, the sole toolchain owner. As a result, plaincargois not routed throughmbxlocally.Blast radius
CI only, plus a new dev tool in mise. A cache miss falls back to a normal build.
Verification
cargo fmt --all --checkand eslint are clean.mbx test --all-features --locked --workspacepassed twice (372 passed, 5 ignored network-gated). The cold run stored 862.7 MiB. The second run with a fresh target dir reported391 hits, 0 misses.mise installpath for mr-boxington, andmbx clippy,mbx llvm-cov, and the-- --ignoredpassthrough on CI.Related issue
None.
Follow-ups (not in this PR)
mise.lock, so the mbx pin has no checksum verification.ci.ymlmise step now also installs mr-boxington on Linux; it could be added toMISE_DISABLE_TOOLS.Checklist
mise run test)mise run lint)BREAKING CHANGE:note is includedSummary by cubic
Caches Rust builds in CI with mbx (mr-boxington) so clippy, tests, and coverage reuse compiled artifacts across runs.
rust.ymlandsonar.ymlnow run clippy, test, and llvm-cov throughmbx;cargo fmtis unchanged.rust-toolchain.tomlbefore the cache action so the key hashes the correctrustc, and uses its owncache-generation.mise.tomlpinsmr-boxington = "1.29.2"; Intel macOS builds it from crates.io because no darwin/x86_64 release archive exists.cargois not routed throughmbx(the miserustoption would overriderust-toolchain.toml), so local users callmbx build/mbx testexplicitly; usage is documented inCONTRIBUTING.md.ci.ymljob skips mr-boxington viaMISE_DISABLE_TOOLS; codspeed and release workflows stay off build caches, and a cache miss falls back to a normal build.Written for commit 1ea7f26. Summary will update on new commits.