Skip to content
Skip to Content
Getting Started

Installation

Install Kache from a release, package manager, crates.io, or Nix

Kache requires the kache client and kache-engine. Keep the same version of both in the same directory when installing a release manually.

cargo install kache --locked --version 2.1.1
kache init

kache init configures Cargo to use Kache. Your Cargo commands stay the same.

Release channels

These docs describe stable v2.1.1. Pin the version as above for reproducible installs, or use an unversioned command for the latest stable release.

Release candidates and betas require an explicit version. Homebrew and Windows also have separate unstable packages; APT has an unstable distribution. See the release list for available versions.

The upgrade guide covers existing installs and what state can start cold.

cargo install kache --locked
# Pin this release:
cargo install kache --locked --version 2.1.1

Cargo builds Kache with your local Rust toolchain, which must be Rust 1.95 or newer.

Package managers

brew install kunobi-ninja/kunobi/kache

Use kunobi-ninja/kunobi/kache-unstable for release candidates and betas.

Nix

nixpkgs

Kache is available in nixpkgs-unstable. Install its package with:

nix profile install github:NixOS/nixpkgs/nixpkgs-unstable#kache

On NixOS, add pkgs.kache to environment.systemPackages and set RUSTC_WRAPPER to "${pkgs.kache}/bin/kache". The separate pkgs.kache.shims output provides C/C++ wrappers in ${pkgs.kache.shims}/bin; put that directory before the real compilers on PATH to cache native compilations.

Kache flake

Use Kache's flake to follow its releases directly or use its NixOS and nix-darwin modules.

The flake builds for x86_64-linux, aarch64-linux and aarch64-darwin. On Intel macOS, use Homebrew, a release binary or cargo install.

The stable branch follows released versions:

nix run github:kunobi-ninja/kache/stable -- --version
nix profile install github:kunobi-ninja/kache/stable

Pin a release tag when updates must be explicit:

nix profile install github:kunobi-ninja/kache/v2.1.1

The flake also exports overlays.default, nixosModules.default and darwinModules.default. The module's services.kache options are defined in packaging/nix/module.nix. enable installs Kache, writes settings to /etc/kache/config.toml and sets KACHE_CONFIG. rustcWrapper, on by default, sets RUSTC_WRAPPER. daemon.enable runs the daemon as a systemd or launchd user service. The module does not put the shims on PATH; use the example below for that.

The package includes cargo, cc, c++, gcc, g++, clang, clang++, and rustdoc symlinks in ${kache}/shims. With this flake's overlays.default applied, enable them in your NixOS configuration:

{ pkgs, ... }:
{
  environment.systemPackages = [ pkgs.kache ];
  environment.sessionVariables = {
    RUSTC_WRAPPER = "${pkgs.kache}/bin/kache";
    PATH = [ "${pkgs.kache}/shims" ];
  };
}

Keep the real compilers later in PATH. The compiler shims cover C and C++; Rust still uses RUSTC_WRAPPER. Point build.rustdoc at the rustdoc link for the supported rustdoc mode. Plain cargo doc passes through. The Cargo shim protects targets while Cargo commands run. Nix builds the symlinks, so no kache init --shims step is needed. The existing ${kache}/lib/kache path remains available.

Supported release targets

PlatformArchitectures
Linux, muslx86_64, aarch64
macOSx86_64, Apple silicon
Windows, MSVCx86_64, ARM64

Other Rust-supported targets may work through cargo install, but they are not release-tested targets.

Shell completions

kache init installs completions for your login shell on Unix: Bash, Zsh, or Fish. Open a new terminal after setup. Run kache init again after an upgrade to refresh the scripts; --check previews changes and --no-shell skips them.

Bash and Zsh load a generated script from ${XDG_DATA_HOME:-~/.local/share}/kache/completions. Fish uses ${XDG_CONFIG_HOME:-~/.config}/fish/completions/kache.fish. Existing files are backed up before replacement.

The official AUR packages also install completions for Elvish. For manual setup or another supported shell, use kache completions <shell>.

Upgrading from 1.x

Follow Upgrading to v2. Finish active builds, install the matching pair, keep the existing configuration, and restart the daemon. Custom installers and container images must include kache-engine.

Verify the install

kache --version
kache doctor
kache doctor --probe

If you have not run it yet, enable Kache with kache init. The quick start shows how to confirm cache hits.

Build from source

To install the current main branch, including features not yet in a release:

cargo install --git https://github.com/kunobi-ninja/kache --branch main --locked kache

Or build from a checkout:

git clone https://github.com/kunobi-ninja/kache
cd kache
cargo install --path . --locked

A git checkout builds with the toolchain pinned in rust-toolchain.toml, which rustup installs on first use.

Both commands install kache, kache-engine, and the native kache-clang-cl and kache-cl compiler launchers. The launchers support build systems that need one executable in CC or CXX; see C/C++ setup. Build locally without installing with cargo build --release --bins. Keep the matching kache-engine beside every frontend you copy from target/release/.

Available for:
Apple macOS logomacOSMicrosoft Windows logoWindowsLinux logoLinux
Download Kunobi