jdx/mr-boxington

Rust

436

538 commits

updated Oct 2, 2026

See the code

README

Mr Boxington, a cardboard cache box with a monocle and a handlebar mustache

mr boxington

A shared cache. A tidier target/.
Reuse Cargo builds across worktrees, keep disk use in check, and run builds together.

Get started · Documentation · Benchmarks · Releases

mbx is a build cache for Rust projects. Cargo still resolves dependencies, plans builds, and runs your tools. mbx restores matching compiler outputs from one shared store and compiles the rest. Each command starts its own cache agent and stops it when the build ends; there is no daemon to manage.

Get started

With mise:

mise use --global --tool-option mr_boxington=true rust mr-boxington

Or with Cargo:

cargo install mbx --locked
mbx setup

With mise 2026.9.2 or newer, the Rust option enables wrapping without an mbx setup hook. Open a shell with mise activation or shims on PATH, check Cargo's path, and use Cargo normally:

cargo build
cargo test --workspace --all-features
cargo clippy --workspace --all-targets -- -D warnings

Interactive builds use cargo-pretty's display by romancitodev, extended with mbx cache information. Follow live and completed crates, browse warnings and test failures, and see cache hits, misses, bypasses, and estimated compiler time saved. The build bar doubles as a cache breakdown: green hits, amber misses, and neutral bypasses.

Cargo remains in charge of run, tests, doctests, and configured runners. CI, redirected output, and explicit output formats keep Cargo's normal output. Set CARGO_TERM_PROGRESS_WHEN=never to disable the display.

A real mixed-cache rebuild after a shared-source edit, with per-crate outcomes

View the still image.

To try mbx without automatic wrapping, install it and run mbx build directly. For coding agents and other non-interactive tools, use mise exec -- cargo build or put mise's shims on their PATH. The setup guide covers desktop applications, older mise versions, and standalone shims.

Verified release archives are available for Linux, macOS, and Windows. All installation options →

What you get

  • Reuse across worktrees. Equivalent compilations share cache keys even when checkout paths differ. Building one worktree warms the next.
  • Automatic cleanup. The store has a disk budget. Managed targets are collected when their checkout disappears, they go unused, or they exceed their budget. Preview collection with mbx gc --dry-run.
  • Parallel builds with a shared budget. Independent Cargo commands share CPU and memory permits and deduplicate identical compilations in flight. Give each command its own target directory to avoid Cargo's directory lock.
  • Faster local edits. mbx keeps private incremental state for crates you are changing while sharing eligible work across the rest of the build.
  • CI reuse. Use GitHub Actions cache, a compatible cache server, or an S3-compatible bucket. Pull request builds restore remote work without publishing new objects through mbx.
  • An explanation for each result. Hits, misses, unavailable lookups, and bypasses are counted separately. mbx explain --last helps diagnose a build.

A cold store needs a build to fill it. Unsupported invocations run normally without caching, and restored debug information can retain the original checkout's paths. See how it works and the caching limits.

Use it in GitHub Actions

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: jdx/mr-boxington-action@v1
      - run: mbx test --workspace

Install your chosen Rust toolchain before the cache action. The default backend restores a pruned Cargo target and registry archive; pull requests are restore-only. See the GitHub Action guide for complete workflows, parallel builds, remote servers, and release policy.

Inspect and maintain the cache

mbx doctor          # check tools, setup, and cache access
mbx tui            # watch builds using this cache
mbx stats           # report lifetime savings and workspace sharing
mbx explain --last  # explain the last recorded build
mbx cache stats     # inspect storage
mbx gc --dry-run    # preview collection
mbx clean          # remove this workspace's managed target
mbx adopt -r ~/src  # adopt existing target directories without deleting outputs

On a filesystem that supports reflinks, restored outputs share data blocks with the store until modified. Elsewhere, mbx copies bytes. Run mbx adopt to bring existing target/ directories under the same storage policy without deleting their contents; a build outside CI does the same for its own checkout. Understand managed targets →

Find your next step

TaskGuide
Set up editors, watchers, and worktreesLocal development
Change budgets or build policyConfiguration
Choose mold, Wild, or toolchain LLDManaged linkers
Share work across CI runnersRemote cache
Cache make or CMake buildsStandalone C and C++
Investigate an unexpected resultTroubleshooting
Look up a commandCLI reference

Contribute

See CONTRIBUTING.md for development setup, documentation checks, tests, and pull request conventions. Ask questions in Discussions; report suspected vulnerabilities through the private process in SECURITY.md.

mbx builds on Cargo and was informed by sccache and kache, which directly inspired its design. Acknowledgements.

License

MIT

Significant stargazers

(top 24 of 27)

Abdelkader Boudih

627 followers · starred Sep 2026

eitsupi

206 followers · starred Aug 2026

John-David Dalton

5,594 followers · starred Aug 2026

Omer Katz

370 followers · starred Sep 2026

jdx/mr-boxington

Rust

436

538 commits

updated Oct 2, 2026

See the code

README

Mr Boxington, a cardboard cache box with a monocle and a handlebar mustache

mr boxington

A shared cache. A tidier target/.
Reuse Cargo builds across worktrees, keep disk use in check, and run builds together.

Get started · Documentation · Benchmarks · Releases

mbx is a build cache for Rust projects. Cargo still resolves dependencies, plans builds, and runs your tools. mbx restores matching compiler outputs from one shared store and compiles the rest. Each command starts its own cache agent and stops it when the build ends; there is no daemon to manage.

Get started

With mise:

mise use --global --tool-option mr_boxington=true rust mr-boxington

Or with Cargo:

cargo install mbx --locked
mbx setup

With mise 2026.9.2 or newer, the Rust option enables wrapping without an mbx setup hook. Open a shell with mise activation or shims on PATH, check Cargo's path, and use Cargo normally:

cargo build
cargo test --workspace --all-features
cargo clippy --workspace --all-targets -- -D warnings

Interactive builds use cargo-pretty's display by romancitodev, extended with mbx cache information. Follow live and completed crates, browse warnings and test failures, and see cache hits, misses, bypasses, and estimated compiler time saved. The build bar doubles as a cache breakdown: green hits, amber misses, and neutral bypasses.

Cargo remains in charge of run, tests, doctests, and configured runners. CI, redirected output, and explicit output formats keep Cargo's normal output. Set CARGO_TERM_PROGRESS_WHEN=never to disable the display.

A real mixed-cache rebuild after a shared-source edit, with per-crate outcomes

View the still image.

To try mbx without automatic wrapping, install it and run mbx build directly. For coding agents and other non-interactive tools, use mise exec -- cargo build or put mise's shims on their PATH. The setup guide covers desktop applications, older mise versions, and standalone shims.

Verified release archives are available for Linux, macOS, and Windows. All installation options →

What you get

  • Reuse across worktrees. Equivalent compilations share cache keys even when checkout paths differ. Building one worktree warms the next.
  • Automatic cleanup. The store has a disk budget. Managed targets are collected when their checkout disappears, they go unused, or they exceed their budget. Preview collection with mbx gc --dry-run.
  • Parallel builds with a shared budget. Independent Cargo commands share CPU and memory permits and deduplicate identical compilations in flight. Give each command its own target directory to avoid Cargo's directory lock.
  • Faster local edits. mbx keeps private incremental state for crates you are changing while sharing eligible work across the rest of the build.
  • CI reuse. Use GitHub Actions cache, a compatible cache server, or an S3-compatible bucket. Pull request builds restore remote work without publishing new objects through mbx.
  • An explanation for each result. Hits, misses, unavailable lookups, and bypasses are counted separately. mbx explain --last helps diagnose a build.

A cold store needs a build to fill it. Unsupported invocations run normally without caching, and restored debug information can retain the original checkout's paths. See how it works and the caching limits.

Use it in GitHub Actions

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: jdx/mr-boxington-action@v1
      - run: mbx test --workspace

Install your chosen Rust toolchain before the cache action. The default backend restores a pruned Cargo target and registry archive; pull requests are restore-only. See the GitHub Action guide for complete workflows, parallel builds, remote servers, and release policy.

Inspect and maintain the cache

mbx doctor          # check tools, setup, and cache access
mbx tui            # watch builds using this cache
mbx stats           # report lifetime savings and workspace sharing
mbx explain --last  # explain the last recorded build
mbx cache stats     # inspect storage
mbx gc --dry-run    # preview collection
mbx clean          # remove this workspace's managed target
mbx adopt -r ~/src  # adopt existing target directories without deleting outputs

On a filesystem that supports reflinks, restored outputs share data blocks with the store until modified. Elsewhere, mbx copies bytes. Run mbx adopt to bring existing target/ directories under the same storage policy without deleting their contents; a build outside CI does the same for its own checkout. Understand managed targets →

Find your next step

TaskGuide
Set up editors, watchers, and worktreesLocal development
Change budgets or build policyConfiguration
Choose mold, Wild, or toolchain LLDManaged linkers
Share work across CI runnersRemote cache
Cache make or CMake buildsStandalone C and C++
Investigate an unexpected resultTroubleshooting
Look up a commandCLI reference

Contribute

See CONTRIBUTING.md for development setup, documentation checks, tests, and pull request conventions. Ask questions in Discussions; report suspected vulnerabilities through the private process in SECURITY.md.

mbx builds on Cargo and was informed by sccache and kache, which directly inspired its design. Acknowledgements.

License

MIT

Significant stargazers

(top 24 of 27)

Abdelkader Boudih

627 followers · starred Sep 2026

eitsupi

206 followers · starred Aug 2026

John-David Dalton

5,594 followers · starred Aug 2026

Omer Katz

370 followers · starred Sep 2026

Languages

Rust

93.9%

Python

3.1%

Shell

2.8%