A second checkout
A new clone or git worktree of the same repository rebuilds every dependency.
Rust first · reads your existing Cargo.toml
100 Rust projects × 12 worktrees each: 76 min with Cargo, 13 min with Mitts 0.3.17. 90,961 compiler runs down to 6,905, on one machine. Measured on three platforms in The Hundred; how to set it up: sharing a build cache between git worktrees.
Mitts plans a Cargo workspace itself and calls rustc directly. Every compile action is keyed by its full set of inputs, stored once in a machine-wide immutable store, and restored into every workspace that needs it — across projects, worktrees and branches. If an input can't be accounted for, the action is rebuilt, not guessed.
source set · Cargo.tomldependency action keysrustc · target triplefeatures · profile · flagstracked environmentsha256(inputs)cas/ab/3f…immutabletarget/debugyour workspaceMeasured with Mitts 0.3.17. 100 open-source Rust projects (100 on macOS and Linux aarch64, 90 on Linux x86_64 measured), each built as 12 worktrees at once, on three machines. Plain Cargo against Cargo with sccache against Mitts: time, CPU, compiler runs and disk. Totals over every project measured, none dropped for variance.
Cargo's cache lives in each workspace's target/. Anything that creates a new one starts from zero.
A new clone or git worktree of the same repository rebuilds every dependency.
A branch that changes Cargo.lock evicts work you'll need again after the switch back.
Two projects using the same serde, syn or tokio build and store them twice.
Coding agents in separate worktrees each pay the full build, at the same time.
CARGO_TARGET_DIR serializes builds behind one lock, and feature sets overwrite each other.rustc call at a time: keys depend on absolute paths unless normalized, linking crates aren't cached, and Cargo still runs every build script.Mitts replaces Cargo's executor, not the compiler. It sees the whole unit graph — so it can key each unit by its dependencies, cache linking units and build-script runs, and let builds share one store safely.
Five phases, from your manifests to restored outputs. A cache hit counts only when the effective inputs match exactly.
Cargo.lock, or resolve against the crates.io sparse index..crate archives in parallel, verify, unpack once per machine.rustc calls, pipelined on .rmeta. Hit: restore. Miss: lock the key, compile, publish atomically.A unit's key includes its dependencies' keys, not their bytes. A change anywhere below a unit changes its key.
Their directives enter the key of the unit they configure; their rerun-if-* declarations decide when a cached run is reused.
An unchanged workspace skips planning and keying. Any mismatch falls back to the full keyed build.
The store, action cache, locks and GC know nothing about Cargo. The Rust adapter turns a Cargo workspace into keyed actions; other languages plug into the same core.
build · run · check · clippy · fmt · test · coverage · explain · fetch · gc · cleanmanifest · resolver · fetcher · features · planner · keys · DAG runner · build scripts · doctestsMitts.toml · compile · linkcontent-addressed store · action cache · key locks · jobserver · fast path · GC · reflinksEvery input below must match for a hit. If Mitts can't see an input, it does not reuse the result.
| Input | Tracked as |
|---|---|
| Toolchain | rustc -vV output |
| Target & profile | target triple, profile settings, RUSTFLAGS and Cargo config rustflags |
| Features | the unit's resolved feature set, resolver 1 or 2 as Cargo would |
| Sources | content hashes of package files and every file rustc reports reading |
| Dependencies | action keys of all dependency units |
| Environment | CARGO_*, RUST_*, wrappers, and every variable read through env! / option_env!, with <unset> recorded |
| Cargo configuration | the .cargo/config(.toml) files Cargo would read |
| Build scripts | directives, OUT_DIR, rerun-if-changed contents and rerun-if-env-changed values |
How each tool reuses work. A qualitative comparison; the measured one, on 100 Rust projects, is on The Hundred page.
| Cargo | Cargo + sccache | Mitts | |
|---|---|---|---|
Reads Cargo.toml / Cargo.lock as is | yes | yes | yes |
| Reuse across workspaces and worktrees | no, per target/ | yes, per rustc call | yes, per unit |
| Key depends on the checkout path | — | yes, unless normalized | no for registry crates; workspace crates when not eligible |
Caches bin and test targets | — | no | yes |
| Caches build-script runs | no | no | yes |
| Concurrent builds of one dependency | wait on the target/ lock | both may compile on a miss | one compiles, the other reuses |
| Remote / team cache | no | yes | planned |
| Windows | yes | yes | no |
Bazel and Buck2 solve a larger problem — hermetic, multi-language builds with remote execution — but need their own build files instead of Cargo.toml.
Mitts caches the actions it can describe completely. Everything else builds normally, and mitts explain says why.
rerun-if input changescdylib, dylib, staticlib crates and untrackable env! readsUnknown inputs are never treated as unchanged. If Mitts can't prove an action is compatible, it builds it — and unsupported Cargo features fail loudly instead of guessing.
No new manifest and no second lockfile. Install the binary (or build from source), then point it at a Cargo workspace. Cargo and rust-analyzer keep working next to it.
$ curl -fsSL https://mittsbuild.com/install.sh | sh # prebuilt binary, checksum verified
$ cargo install --path . # or from a clone of the repository
$ cd your-workspace
$ mitts build
target/debug, like CargoPre-release; hardening for real projects continues. The benchmark study is published: The Hundred: 100 Rust projects on three machines, with plain Cargo and sccache as baselines, cold, warm and changed-input runs, and the cases where Mitts is not faster. The documentation covers every command and how the cache works.