github kunobi-ninja/kache v1.2.0

latest release: v1.2.1
5 hours ago

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.0

Then 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_bytes to change the floor, or to 0 to turn it off. #1549
  • Removing target directories to free space stays opt-in. Turn it on with cache.auto_recover_targets = true or by answering yes in kache init. #1549
  • kache targets finds 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 each target/ 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 by kache clean. #1546

Added

  • kache status runs kache 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. --json carries it as volume. #1545, #1549

Fixed

  • kache clean forgets 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 targets lists 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.exe get cache keys. Kache looks for rust-lld where rustc does, in the toolchain's own tool directory, and accepts the identical lib<name>.a and <name>.lib copies that cc writes 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-flavor other than lld-link still runs uncached. Thanks to H1X4 (@H1X4Dev). #1553
  • kache stats explains a cache above its limit: blobs that a target/ 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_bytes in 1.1 to have targets removed, also set auto_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

jleni H1X4Dev

Full changelog: v1.1.1...v1.2.0

Don't miss a new kache release

NewReleases is sending notifications on new releases.