Kache 1.2.0 finds the target directories filling your disk, keeps track of them across restarts, and frees space on its own when the disk runs low. Cache entries go first; target directories go only if you ask.
cargo install kache --locked --version 1.2.0Then run kache init again: it asks whether free-space recovery may also remove idle target directories. Other installation methods.
What changes for you
- Cache eviction below 10 GiB free is now on by default. When the volume holding the cache drops below 10 GiB free, builds evict cache entries, with the usual protections for recent hits, fresh imports and pending uploads. It is off in CI, where a runner's disk lasts one job and the CI cache keeps entries for later jobs. Set
cache.auto_recover_min_free_bytesto change the floor, or to0to turn it off. #1549 - Removing target directories to free space stays opt-in. Turn it on with
cache.auto_recover_targets = trueor by answering yes inkache init. #1549 kache targetsfinds far more of your targets. The daemon now looks in every Git worktree of the repositories you build, and in the other repositories next to them, and records eachtarget/directory Cargo created, including ones you never built through Kache. On one machine with many agent worktrees, the list went from 34 to 55 directories (54 to 94 GiB). It runs at most hourly when the machine is quiet, and never in Desktop, Documents or your home folder itself. #1547- Targets no longer disappear after a restart. macOS can renumber a volume after a restart, which made every target Kache knew look replaced: hidden from
kache targets, forgotten bykache clean. #1546
Added
kache statusrunskache stats. #1545- A Volume row in
kache stats: free and total space of the cache's volume, and whether recovery covers cache entries only or idle targets too.--jsoncarries it asvolume. #1545, #1549
Fixed
kache cleanforgets targets of deleted worktrees and, when it removes nothing, shows what it keeps with sizes and what to run next. Its JSON report carries the same rows and next steps. #1544- The daemon forgets a target directory once it is gone, also when the whole worktree was deleted. #1544, #1546
- Building one dependency on its own (
cargo build -p serde) no longer records that dependency's source as your workspace, which kept Git discovery from finding your other worktrees. The next build of your workspace corrects existing entries. #1546 - The daemon no longer deletes an idle target that a build just used. A build that recorded a target while the daemon's quiet sweep was deleting another one could lose that target to the same sweep. #1557
kache targetslists each target by its own path, so several targets of one workspace no longer look identical. #1548- Windows MSVC builds that link with
rust-lld.exeget cache keys. Kache looks for rust-lld where rustc does, in the toolchain's own tool directory, and accepts the identicallib<name>.aand<name>.libcopies thatccwrites for MSVC targets. On one 580-unit workspace, the units compiled without a key went from 62 to 0. A rust-lld link with a-C linker-flavorother thanlld-linkstill runs uncached. Thanks to H1X4 (@H1X4Dev). #1553 kache statsexplains a cache above its limit: blobs that atarget/directory still holds as a clone are left out of the limit, because evicting them frees no disk. #1545
Upgrade notes
- If you set
auto_recover_min_free_bytesin 1.1 to have targets removed, also setauto_recover_targets = true. Without it, the floor now evicts cache entries only. - If you want no eviction at all, set
auto_recover_min_free_bytes = 0.
Contributors
Full changelog: v1.1.1...v1.2.0