Repolode
kunobi-ninja

kunobi-ninja/kache

A compiler cache for Rust, C/C++ and CUDA that restores matching build outputs across worktrees and CI runs instead of rebuilding them.

Stars
1,361
Forks
72
Open issues
30
Last commit
21 hours ago

What is it?

Kache is a compiler cache that stores build outputs keyed by their inputs, toolchain and build settings, then restores them when a later build produces the same key. It targets Rust, C/C++ and single-source CUDA compilations on Linux, macOS and Windows, and it can share work across git worktrees and CI runs.

Identical output bytes are stored once within a disk budget. On filesystems with copy-on-write cloning, restored outputs share disk blocks with the cache. Compiles with the same cache key share one in-flight build, and the scheduler paces compiler processes.

The local cache works on its own. Remote storage can be S3-compatible storage, Google Cloud Storage, a shared filesystem or an OCI registry. Commands such as `kache explain` report why a build missed, and unsupported compiler invocations run normally.

Key features

  • 01Restores eligible Rust, GCC, Clang and CUDA compiler outputs from cache.
  • 02Stores identical outputs once under a configurable disk budget.
  • 03Uses copy-on-write cloning to share disk blocks on supporting filesystems.
  • 04Shares in-flight builds for matching cache keys.
  • 05Supports S3, Google Cloud Storage, shared filesystems and OCI registries as remote storage.
  • 06Explains cache misses with `kache explain` and a live `kache monitor`.

Use cases

  • Speeding up repeated Rust builds across several git worktrees of the same repository.
  • Sharing compiled artifacts between CI runs with a remote cache.
  • Reducing disk use when many worktrees build the same large dependency tree.
  • Caching C/C++ or CUDA compilations in projects built with Make or CMake.

Quick start

  1. 1

    Install Kache v2.0.0 with Cargo

    cargo install kache --locked --version 2.0.0
  2. 2

    Enable Kache for your build tools (shows changes before applying)

    kache init
  3. 3

    Check the setup with a local probe

    kache doctor --probe

Things to know

  • The Cargo install needs Rust 1.95 or newer.
  • Rust executables and build-script runs are cached by default only on Linux and macOS; Windows caching is more limited.

Topics

#build-cache#rust#compiler-cache#ci#hardlinks#s3#c-cpp#cuda#caching#developer-tools

FAQ

What is kache?
A compiler cache for Rust, C/C++ and CUDA that restores matching build outputs across worktrees and CI runs instead of rebuilding them. Kache is a compiler cache that stores build outputs keyed by their inputs, toolchain and build settings, then restores them when a later build produces the same key. It targets Rust, C/C++ and single-source CUDA compilations on Linux, macOS and Windows, and it can share work across git worktrees and CI runs.
Is kache free to use? What license does it have?
kache is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is kache still maintained?
Actively maintained. The last commit to kache was on Nov 5, 2026.
What can I use kache for?
Speeding up repeated Rust builds across several git worktrees of the same repository. Sharing compiled artifacts between CI runs with a remote cache. Reducing disk use when many worktrees build the same large dependency tree. Caching C/C++ or CUDA compilations in projects built with Make or CMake.
How do I install kache?
Install Kache v2.0.0 with Cargo: cargo install kache --locked --version 2.0.0 Enable Kache for your build tools (shows changes before applying): kache init Check the setup with a local probe: kache doctor --probe
Where can I get kache?
The source code and installation instructions are on GitHub: https://github.com/kunobi-ninja/kache

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects