Build faster. Cache smarter. Drop-in ready.
A Rust-powered drop-in replacement for Ninja with built-in caching and modern scheduling. Cut your build times without changing your build files.
brew tap neul-labs/tap
brew install rninjanpm install -g rninja-clipip install rninja-clicargo install rninja
### From GitHub Releases
Download prebuilt binaries from the [Releases page](https://github.com/neul-labs/rninja/releases).
### Build from source
```bash
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
MIT License - see LICENSE for details.
Built with Rust by Neul Labs