Hi everyone,
Last week I published a shared build cache manager that handles compiled dependencies and Cargo’s artifacts inside a shared directory. The idea is simple: why recompile the same dependencies every time? epicenter takes advantage of the “freshness” rules Cargo uses when compiling a project and lets you reuse what’s already built. No wrapper, no RUSTC_WRAPPER like kache or sccache.
These are some benchmarks on 5 test projects with 37 dependencies (best case: a monorepo with a shared platform crate): five cold builds went from 71.3 s to 15.3 s, and disk usage dropped from 3.65 GiB to 0.91 GiB.
epicenter is a state layer for Cargo builds. It uses features of Cargo that for some reason are not enabled by default, like a shared build directory, and rust-lld instead of the default linker (unfortunately this can’t be used on macOS, because ld64.lld is not a drop-in replacement for Apple’s linker). It manages everything as three tiers: a durable vault (store) of compiled units that survives cargo clean, the shared build dir that every project compiles into, and disposable per-job work dirs seeded from the vault.
How is this different from sccache or kache? They are rustc wrappers: they cache compiler outputs keyed by their inputs, but Cargo still invokes rustc (through the wrapper) for every unit, and each project’s target/ gets its own copy of the artifacts. epicenter works one level above, on the state Cargo itself uses to decide that a unit is Fresh. Restored units never reach rustc at all, and files are hard-linked rather than copied. It’s a different approach to the same problem, and the two can even be combined if you want.
I also developed it to help everyone writing Rust with agents who need different workdirs without creating a worktree for every feature. epicenter lets you create per-job build dirs seeded from the vault, without Cargo locking them and without duplicated dependencies. It also manages the dependencies for you: you can see what’s in the cache, prune old stuff by age, or evict a specific crate or a stale toolchain generation, with a dry run first so nothing gets deleted by surprise.
It’s built to be plug and play: run epicenter setup (or epicenter setup --fast) once, then keep building like always. It works with both stable and nightly toolchains. Linux/WSL and Windows are verified, while macOS is only compile-verified for now, so if you’re on a Mac I’d really appreciate it if you tried it and told me what breaks.
Requires Rust 1.91+.
https://crates.io/crates/epicenter-cli