github kunobi-ninja/kache v0.23.0
v0.23.0: build scripts, Clippy, and C keys without a preprocess

4 hours ago

This release makes warm builds cheaper where Cargo used to bypass the cache, and cold C/C++ builds cheaper where Kache used to run the preprocessor first. Build-script runs and Clippy units are cached. C and C++ compiles without a recorded read set compile once and key from what they read. kache init finishes on machines without a login service.

cargo install kache --locked --version 0.23.0

Homebrew, APT, AUR, winget, Scoop, Chocolatey, mise, Nix, and the GitHub release binaries also ship 0.23.0.

Highlights

  • Build scripts and Clippy hit the cache. A build_script_* run is keyed on its binary, environment, and declared inputs, and restored instead of executed. cargo clippy units are keyed like rustc plus the Clippy version and configuration, with diagnostics replayed. On a runner with six overlapping Cargo jobs, the warm cell went from 8.4 s to 3.1 s on eza and from about 35 s to 8.2 s on hk.
  • C/C++ keys without a preprocess. A compile with no memo runs once with a private -MD capture and keys from the digest of the files it read. The memo it leaves keys the next build without running anything. Cold hk went from 105.6 s to 83.3 s, eza from 45.1 s to 40.3 s, on the same six-job cells.
  • kache init on CI and containers. When the login service cannot be installed, init says so and starts the daemon directly instead of exiting 1 after configuring Cargo.

Added

  • build scripts: the rustc wrapper preserves each build-script binary beside a launcher and caches its run. Declared rerun-if-changed and rerun-if-env-changed inputs are part of the key; directories go through a tree memo that only memoises settled trees. Registry packages with proc-macro dependencies may use input predictions when their package and OUT_DIR trees are unchanged, instead of a dep-info pre-pass every build. (#1072 by @jleni)

  • clippy: clippy-driver rustc … units are cached. Other workspace wrappers stay uncached. (#1072 by @jleni)

  • cc: compile-first keying on a certain miss: no remote, no fallback wrapper, a driver that passed a one-time capture probe, and a memo identity spelled in mapped or toolchain paths. Everything else keeps the preprocessor as discovery. The memo identity is shared across build directories, Cargo commands, and checkouts: OUT_DIR, the target directory, and other crates' OUT_DIRs map to sentinels, keyed environment values go through the maps, and Cargo links metadata is excluded. deferred_discovery = false turns it off. (#1077 by @jleni)

    [cache]
    deferred_discovery = false
  • cache: shared_hardlink_restores lets every target directory hardlink a store blob on filesystems without reflink. Opt in for single-use target directories only. (#1072 by @jleni)

  • fallback: a configured sccache fallback that fails to launch or exits unsuccessfully is retried once with the direct compiler. On macOS, a bounded preflight detects a local sccache server the sandbox denies access to the output path and bypasses it before compiling. Events record the wrapper attempt separately from the final result (event schema 19). (#1065 by @jleni)

  • keys: the 13 cc -print-file-name spawns per linked Linux output become one file read validated by directory stamps. MSVC link.exe and cl.exe banners are memoised in the cache directory. (#1072, #1069 by @jleni)

Fixed

  • init: kache init continues when the login service cannot be installed, on Linux without a systemd user session and on Windows for non-admin users, and leaves no unit file behind. Without a terminal and without --yes, it exits 1 instead of exiting 0 after changing nothing. (#1083 by @jleni)
  • wrapper: storage-layout advice (EXDEV and EPERM hardlink fallbacks, cross-volume and no-CoW notes) goes to the tracing log at warn instead of the compiler's stderr, where it broke gates that reject unexpected compiler output. Clone faults still print. (#1073 by @jleni)
  • hits: file-hash memo rows are written in one short transaction per process, and a hit re-stamps last_accessed at most once per 30 s per entry. (#1072 by @jleni)
  • chart: podAnnotations no longer renders the annotations: key twice, and podLabels renders under labels. (#1075 by @jleni)
  • service: kunobi-auth 0.11.0. (#1078 by @jleni)

Docs

  • kache init is the only documented setup path; generic CI uses kache init --yes. Gaps are covered with sccache as a fallback ([cache] fallback = "sccache"). (#1079, #1087 by @jleni)
  • README: what Kache does and how it works before the details, CUDA and the three platforms named, and terminal recordings of the second-worktree cache hit, why-miss, monitor, clean, and kache init with doctor. The docs pages embed the same scenes as video. (#1084, #1086, #1088 by @jleni)
  • Build-script caching and its residual risks in how-it-works/build-scripts; compile-first C keying in getting-started/c-cpp and how-it-works/cache-key. (#1072, #1077 by @jleni)

Contributors

jleni

Full changelog: v0.22.0...v0.23.0

Don't miss a new kache release

NewReleases is sending notifications on new releases.