A second checkout
A new clone or git worktree of the same repository rebuilds every dependency.
Rust first · reads your existing Cargo.toml
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/mitts/isolatedCargo'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: verify and 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, not a performance claim.
| 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, test and proc-macro units | — | 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. Build from source, then point it at a Cargo workspace. Cargo and rust-analyzer keep working next to it.
$ cargo install --path . # from a clone of the repository
$ cd your-workspace
$ mitts build
target/mitts/Pre-release. Milestones M0–M6 are complete; hardening for real projects and a reproducible benchmark study are in progress. No performance numbers are published until that study is — with fixed hardware, cold, warm and changed-input runs, and the stronger of Cargo and sccache as the baseline.