A shared cache for Cargo builds
open sourceMITself-hostablefree
mbx is a build cache for Rust projects by Jeff Dickey, the author of mise. Cargo still resolves and plans the build; mbx restores matching compiler outputs from one shared store (reflinked or hard-linked into place) and compiles the rest. Each command starts its own cache agent, so there is no daemon. It manages target directories with disk budgets and garbage collection, shares CPU and memory permits between parallel Cargo commands, and in CI reads from the GitHub Actions cache, a cache server or an S3 bucket while writing only from protected branches.
Ways to install
Package managers
Problems it solves
- every git worktree of my Rust project rebuilds the whole dependency tree
- old target directories pile up and I only notice when the disk is full
- two cargo commands at once fight over the build directory lock
- I want cargo build to reuse work from my other checkouts without changing how I run cargo
- AI agents running cargo test in parallel max out my CPU and RAM
- garbage collect build output for branches and checkouts I've deleted
- speed up Rust CI with a cache that pull requests can read but not poison
- see how many crates were cache hits and how much compile time I saved
- explain why the last build recompiled things it shouldn't have
- cap how much disk my Rust builds are allowed to use
- share compiled crates between CI runners via an S3 bucket
Features
- reuse across worktrees
- managed target dirs with budgets and GC
- shared CPU/memory permits across parallel builds
- in-flight compile dedupe
- private incremental state for edited crates
- GitHub Actions cache, cache server or S3 backends
- writes only from protected branches
- cache-aware build display (cargo-pretty)
- mbx explain / stats / tui
- no daemon
View 2 more
- managed linkers (mold, Wild, LLD)
- standalone C/C++ caching for make and CMake
Capabilities
| Has a command line tool | plan not known |
|---|
Recommended by
- “Is it useful to study the design of the external tool mr boxington to inform your solution design around caching” sanmai-NL, github, 2026-11-13 source
Alternatives
The same job
These do what Mr Boxington (mbx) does.
- Kache Build once. Reuse the work.
- Swatinem/rust-cache A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.
- cargo-sweep A cargo subcommand for cleaning up unused build files generated by Cargo
- sccache Shared compilation cache for C, C++, Rust and CUDA, stored locally or in the cloud
- cargo-chef Cache the dependencies of your Rust project and speed up your Docker builds.
