Skip to content

ci: cache Rust builds with mbx (mr-boxington) - #135

Merged
amondnet merged 4 commits into
mainfrom
amondnet/mbx-build-cache
Nov 8, 2026
Merged

amondnet merged 4 commits into
mainfrom
amondnet/mbx-build-cache

Conversation

@amondnet

@amondnet amondnet commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Mirrors pleaseai/shunt#894. rust.yml (build and ignored-tests jobs) and sonar.yml (coverage) had no Rust build cache. Each job now installs the toolchain pinned in rust-toolchain.toml, then jdx/mr-boxington-action v1.7.3 (SHA-pinned, mbx 1.29.2, default GitHub cache backend, per-job cache-generation), and runs clippy, test, and llvm-cov through mbx.

What changed

  • rust.yml and sonar.yml run clippy/test/llvm-cov through mbx. cargo fmt is unchanged.
  • mise.toml pins mr-boxington = "1.29.2". Intel macOS builds it from crates.io via mise.macos-x64.toml and the .miserc.toml auto_env, because there is no darwin/x86_64 release archive.
  • CONTRIBUTING.md documents mbx build / mbx test for local use.

Scope

The codspeed and release workflows are untouched; release builds stay off build caches.

Tradeoffs

  • mise's mr_boxington rust-tool option is not used. A rust entry requires a version (verified on mise 2026.11.1), which would override rust-toolchain.toml, the sole toolchain owner. As a result, plain cargo is not routed through mbx locally.

Blast radius

CI only, plus a new dev tool in mise. A cache miss falls back to a normal build.

Verification

  • actionlint is clean on both workflows. cargo fmt --all --check and eslint are clean.
  • Locally, mbx test --all-features --locked --workspace passed twice (372 passed, 5 ignored network-gated). The cold run stored 862.7 MiB. The second run with a fresh target dir reported 391 hits, 0 misses.
  • Not verified: CI itself (the first run is cold), the linux-x64 mise install path for mr-boxington, and mbx clippy, mbx llvm-cov, and the -- --ignored passthrough on CI.

Related issue

None.

Follow-ups (not in this PR)

  • There is no mise.lock, so the mbx pin has no checksum verification.
  • The ci.yml mise step now also installs mr-boxington on Linux; it could be added to MISE_DISABLE_TOOLS.

Checklist

  • PR title follows Conventional Commits
  • Tests added or updated, and the suite passes (mise run test)
  • Lint/format pass (mise run lint)
  • Documentation updated if behavior changed
  • No breaking change, or a BREAKING CHANGE: note is included

Summary by cubic

Caches Rust builds in CI with mbx (mr-boxington) so clippy, tests, and coverage reuse compiled artifacts across runs.

  • rust.yml and sonar.yml now run clippy, test, and llvm-cov through mbx; cargo fmt is unchanged.
  • Each job installs the toolchain pinned in rust-toolchain.toml before the cache action so the key hashes the correct rustc, and uses its own cache-generation.
  • mise.toml pins mr-boxington = "1.29.2"; Intel macOS builds it from crates.io because no darwin/x86_64 release archive exists.
  • Plain cargo is not routed through mbx (the mise rust option would override rust-toolchain.toml), so local users call mbx build/mbx test explicitly; usage is documented in CONTRIBUTING.md.
  • The JS-only ci.yml job skips mr-boxington via MISE_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.

Turn on auto-fix

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.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .miserc.toml Resolved
Comment thread mise.macos-x64.toml Resolved
Comment thread CONTRIBUTING.md Resolved
@codecov

codecov Bot commented Nov 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@amondnet
amondnet marked this pull request as ready for review November 8, 2026 14:14
@codspeed

codspeed Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

1 warning

⚠️ 1 benchmark is dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 7 untouched benchmarks


Comparing amondnet/mbx-build-cache (1ea7f26) with main (d414bc8)

Open in CodSpeed

@greptile-apps

greptile-apps Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable new issues were found.

Summary

Adds mbx caching for Rust checks and coverage, plus optional local use through mise.

  • Rust CI checks reuse compiled work through mbx.
  • Contributors can install and run mbx for local builds.

No actionable new issues were found.

Reviews (2) · Last reviewed commit: "chore: apply AI code review suggestions" · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread CONTRIBUTING.md Resolved
Comment thread mise.toml Resolved
Comment thread mise.toml Resolved
Comment thread .github/workflows/sonar.yml Resolved
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.
@amondnet

amondnet commented Nov 8, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@sonarqubecloud

sonarqubecloud Bot commented Nov 8, 2026

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .miserc.toml Resolved
Comment thread mise.macos-x64.toml Resolved
Comment thread mise.toml Resolved
Comment thread CONTRIBUTING.md Resolved
@amondnet
amondnet merged commit 48bea95 into main Nov 8, 2026
14 checks passed
@amondnet
amondnet deleted the amondnet/mbx-build-cache branch November 8, 2026 15:53
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.

1 participant