rninja is a drop-in replacement for Ninja with built-in caching — build faster, cache smarter, change nothing.
Website · Documentation · GitHub
A Rust-powered build tool with modern scheduling that reads your existing .ninja files and cuts build times without changing a line of your build configuration.
brew tap neul-labs/tap
brew install rninjanpm install -g rninja-clipip install rninja-clicargo install rninjaDownload prebuilt binaries from the Releases page.
git clone https://github.com/neul-labs/rninja
cd rninja
cargo install --path .rninja works exactly like ninja—just swap the binary:
# Use directly
rninja
# Or with your existing workflow
rninja -C out/Release
rninja -j8 my_target
# Symlink as ninja for seamless integration
ln -s $(which rninja) /usr/local/bin/ninjaAll ninja flags work: -C, -j, -k, -d, -t, and more.
| Feature | Benefit |
|---|---|
| Drop-in compatible | Works with existing .ninja files from CMake, GN, Meson, or any generator |
| Built-in caching | Content-addressed cache skips redundant work automatically |
| Modern scheduler | Rust async runtime keeps all cores busy, minimizing idle time |
| Remote cache ready | Share cached artifacts across machines and CI runners |
| Scenario | Speedup |
|---|---|
| Warm incremental builds | 2× – 5× |
| CI with shared cache | 2× – 5× |
| Cold builds | 1.3× – 2× |
See BENCHMARK.md for detailed comparisons.
rninja works out of the box with sensible defaults. For customization:
# Generate a sample config
rninja -t config -vConfig files are loaded from:
.rninjarc(project)~/.rninjarc(user)~/.config/rninja/config.toml(XDG)
| Variable | Description |
|---|---|
RNINJA_CACHE_DIR |
Cache directory location |
RNINJA_CACHE_ENABLED |
Enable/disable caching (0 or 1) |
RNINJA_REMOTE_URL |
Remote cache server URL |
RNINJA_CACHE_MODE |
local, remote, or both |
All ninja subtools plus extras:
rninja -t clean # Remove built files
rninja -t compdb # Dump JSON compilation database
rninja -t graph # Output graphviz dot file
rninja -t deps # Show stored dependencies
rninja -t query # Show inputs/outputs for a path
rninja -t config # Show/generate configurationRun rninja -t list for the complete list.
- C/C++ projects with multi-minute incremental builds
- CI pipelines running many builds per day
- Monorepos with shared code across teams
- Game studios and performance-sensitive teams already using Ninja
- Anyone who wants faster builds without changing their workflow
- Parse your existing
build.ninjafile (no changes needed) - Hash inputs, compiler flags, and environment
- Check cache for matching artifacts
- Build only what's actually changed
- Store results for next time
The local cache uses sled for metadata and content-addressed blob storage for artifacts. Optional remote caching uses nng for high-throughput artifact sharing.
Contributions welcome! Please see our GitHub repository for:
- Bug reports and feature requests
- Pull requests
- Architecture discussions
Explore the rest of the Neul Labs developer tools:
| Project | Description |
|---|---|
| rjest | A blazing-fast, Jest-compatible test runner — 100x faster warm runs. |
| rpytest | Run your pytest suite faster. Change nothing. |
| gity | Make large Git repositories feel instant. |
| stkd | Stacked diffs for GitHub and GitLab. |
| grite | The issue tracker that lives in your repo. Built for AI agents. |
Learn more at neullabs.com.
MIT License - see LICENSE for details.
Built with Rust by Neul Labs