Windows builds
Install the v2 pair and check Rust, PDB, clang-cl, and CUDA eligibility
Install Kache through a supported package manager
or extract the Windows release ZIP. Keep kache.exe and kache-engine.exe from
the same release in the same directory. A standalone client EXE is not a complete
v2 installation.
kache init
kache doctor
kache doctor --probe
cargo build
Init configures the Cargo wrapper and can register a Task Scheduler daemon.
Windows does not use the Unix compiler-name shim farm or Unix shell-startup
edits. For PowerShell completions, generate the script with
kache completions powershell and load it from your profile.
Rust libraries and executable outputs
Eligible Rust libraries use the artifact cache. Executable caching remains opt-in on Windows:
[cache]
cache_executables = true
For one PowerShell session, set $env:KACHE_CACHE_EXECUTABLES = "1" before the
build. If you use the GitHub Action, configure its cache-executables input
instead of relying on the CLI default.
V2 pairs a cached MSVC PE executable with the sibling PDB named by its debug record, checking that their identities agree. Missing/mismatched PDBs, unsupported debug layouts, FASTLINK dependencies, and incremental-link sidecars leave the compile uncached. A PE without a CodeView record needs no PDB. See Windows executable keys for the exact admission rules.
Rust links can key supported rust-lld toolchains, compiled resource inputs,
supported application manifests passed with /MANIFESTINPUT and /MANIFEST:EMBED,
and modeled runtime/default-library selections. This does not make direct
cl.exe object compilation cacheable. Since v2.1.0, DLL caching also retains import
libraries omitted from rustc's artifact notifications.
Long Rust commands can remain cacheable: RC.2 moves Kache-injected arguments into a response file when they would overflow the Windows command line. RC.4 also passes arguments through a temporary file when the local-engine handoff would exceed that limit, fixing engine startup failures with error 206. Unsupported invocations still pass through.
Daemon execution
The frontend keeps native compiler processes, console access, and brokered restores under the client's token and job lifetime. The daemon coordinates the cache pipeline over an authenticated named pipe.
kache doctor reports daemon health separately from compiler-execution
eligibility. A refused handoff can use the local engine before Commit. After
Commit, a lost connection fails the invocation rather than rerunning it.
RC.2 supports an explicit trust option for certain known process-identity token differences. It must be enabled in both configurations and requires a daemon restart. Other token checks still apply. Read Process restrictions before enabling it.
The execution diagnostic distinguishes process-identity token differences from incompatible access-token contexts and failed security queries. The trust option only permits the first case. Keep the full diagnostic when reporting a refused handoff; changing trust does not fix incompatible tokens.
Since v2.1.0, Kache uses the local engine after a client-side permission denial, without starting the daemon again. Requests the client cannot prepare for transfer also use this fallback. A missing or unavailable daemon still gets a startup attempt. Fallbacks cannot rerun the compiler after Commit.
The logical daemon.sock path has no socket file on Windows. The daemon uses
a named pipe derived from that path, including for file-hash requests. Check
kache daemon to test reachability.
Slow native-link keys
Rust proc-macros also link native code. Their keys inspect the selected MSVC tools and CRT libraries even when executable caching is disabled.
On a cold cache, the daemon prepares large runtime hashes in the background.
Initial native units compile without caching while this work runs. Once the
hashes are ready, later units use the normal cache path. kache explain labels
those initial compiles as runtime warmup.
To wait for the hashes and cache from the first native compile:
kache config set cache.native_runtime_warmup false
Ordinary runtime-library hashes reuse file-hash memos when NTFS supplies a file
index and change time. Since v2.1.0, Kache also uses these memos
for Microsoft link.exe and cl.exe banner digests. A replaced file or an edit
that restores its old modification time invalidates the memo. Other filesystems,
or failed identity queries, keep caching artifacts but read bytes on each key. Explicit
/DEFAULTLIB requests still validate and hash the selected archive together.
An unavailable or older daemon uses the synchronous path too.
Record the slow build with phase tracing:
$env:KACHE_PHASE_TRACE_DIR = Join-Path $env:TEMP 'kache-phases'
cargo build
The trace separates native_msvc_discovery, native_msvc_banner_hash,
native_msvc_banner_run, and native_msvc_runtime. Ordinary runtime and
Microsoft tool-banner reads also contribute to file-hash byte counts. These
intervals are needed to locate a cold-key delay. A small hash-byte count alone
does not identify its cause. See phase tracing for scope and
measurement overhead.
Daemon preparation has separate native_msvc_runtime_warmup spans. Its file
reads run outside the compiler's key calculation. Start the daemon with the
same KACHE_PHASE_TRACE_DIR to capture those spans; a running daemon keeps its
startup environment.
C/C++, CUDA, and documentation
- GCC, Clang, and eligible clang-cl object compiles can use explicit prefix wrapping or build-tool launcher settings. clang-cl debug objects stay machine-local. See C/C++.
- Single-source
nvcc -cand separate-compilation object outputs can use the CUDA cache, including CMake's modeled host/compiler flags. Device and final links pass through. See CUDA. - Windows
cargo docpasses through. Unix rustdoc caching also has toolchain restrictions; it is not a general v2 promise for every documentation build.
On volumes without copy-on-write support, restores can copy bytes. Logical target sizes alone do not demonstrate shared disk blocks. See Storage and cleanup.