Skip to content

v1.2.2

Latest

Choose a tag to compare

@pecorino-bot pecorino-bot released this 15 Oct 17:53
· 18 commits to main since this release
Immutable release. Only release title and notes can be modified.
v1.2.2
96052b4

Kache 1.2.2 makes kache clean tell you what it is waiting for instead of skipping every target, and makes the CLI report what it actually did. Several commands now exit with a different code; read the upgrade notes if a script calls Kache.

cargo install kache --locked --version 1.2.2

Other installation methods.

Cleanup

  • kache clean names what blocks it. While any Cargo command run through Kache is open, such as a cargo run left running for hours, cleanup can't delete targets. --yes used to skip each target with "in use" and remove nothing. It now prints one line naming the command, its pid and how long it has run, and the dry run shows the same thing, so the preview matches the real run. kache clean and kache gc show a spinner while they work. #1563
  • Failed removals are reported. A removal that fails is listed, and the command exits 1. In JSON it appears under failed with success: false. #1568
  • Clearing the cache keeps the list of tracked targets. kache clean --cache --yes used to forget every tracked target, so targets of deleted worktrees stayed on disk. #1568
  • A target reached through .. stays tracked after its worktree is deleted, for example CARGO_TARGET_DIR=<worktree>/../shared. #1568
  • kache targets says orphaned targets are automatic. The daemon removes targets of deleted worktrees a day after their last build. --orphans is now listed in help for removing them sooner. #1575

This release doesn't change which commands block cleanup: a long cargo run through Kache still blocks every target until it exits.

Setup and configuration

  • kache config no longer overwrites your file. It refuses a config that doesn't parse, names the error, and keeps comments and unknown keys when it saves. Other commands warn once that they are using the defaults. #1567
  • kache doctor --fix edits only an sccache rustc-wrapper, and backs up the Cargo config first. It used to replace "sccache" everywhere in the file. #1567
  • kache init --check matches the real run, including the build.rustdoc edit, and --json reports what a run did. init accepts --dry-run/-n. #1576
  • build.rustdoc setup handles commented table headers in an existing Cargo config, and leaves the file alone when the edit isn't safe. Thanks to Viktor (@viktorius007). #1583
  • kache doctor has one RUSTC_WRAPPER check, where two could disagree, and its hints name commands that exist, such as kache init --shims. #1576

Reports

  • Edit-rebuild sessions are counted. kache stats reported "0 of 0 crates from cache" for a session of incremental rebuilds. It now counts every compile Kache ran without storing. #1574
  • kache explain <crate> reports the latest event, including an uncached compile after an old miss. "Costliest first" is sorted by compile time. #1574
  • Units and times agree across formats: GiB and MiB in Markdown reports, one decimal for durations under a minute, local times everywhere. #1574
  • kache stats --redact removes every path, including build roots and store paths it used to leave in. #1565
  • Skipped builds show their own reason in reports. Thanks to Viktor (@viktorius007). #1578
  • A torn write no longer hides the events around it. Thanks to Viktor (@viktorius007). #1579

Caching

  • Build-script rerun-if-changed lines with surrounding spaces are honored, as Cargo does. Predictions recorded by the old parser are not reused. Thanks to Viktor (@viktorius007). #1564

Security

Upgrade notes

Exit codes and argument checks changed. Scripts that relied on the old behaviour:

  • Argument errors exit 2 with invalid_arguments. --format, list --sort and telemetry write --phase reject unknown values; every documented spelling still works. kache sync --pull --push is now an error. #1573
  • Without a terminal, a command that would ask first exits 1 unless you pass --yes, --dry-run or --json. kache clean --cache, --crate and --units used to print "Nothing removed." and exit 0. #1568, #1576
  • kache daemon stop with no daemon running exits 0. Output piped into a closed reader, such as kache … | head, ends with 0 unless the command was reporting a failure. #1573
  • kache explain <crate> --json reports "command": "explain" instead of why-miss. No other JSON field was renamed or removed. #1574

Contributors

jleni viktorius007

Full changelog: v1.2.1...v1.2.2