rninja¶
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.
-
23x Faster No-op Builds
Sub-millisecond detection when nothing needs rebuilding. No more waiting for build systems to check thousands of files.
-
Content-Addressed Caching
BLAKE3 hashing ensures correct, reproducible builds. Automatic cache restoration for repeated builds.
-
Remote Cache Sharing
Share build artifacts across your team and CI runners. Dramatically reduce CI build times with shared caches.
-
Drop-in Compatible
Works with existing
.ninjafiles from CMake, Meson, GN, or any generator. No changes to your build configuration required.
Quick Install¶
Quick Start¶
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
# All ninja flags work
rninja -v -d explain
Performance at a Glance¶
| Scenario | Speedup | Description |
|---|---|---|
| No-op builds | Up to 23x | Sub-millisecond detection when nothing changed |
| Warm incremental | 2x - 5x | Cache hits for unchanged build steps |
| CI with shared cache | 2x - 5x | Team-wide artifact sharing |
| Cold builds | 1.3x - 2x | Better parallelism and scheduling |
Who is rninja for?¶
- C/C++ Projects
- Multi-minute incremental builds become seconds with caching
- CI Pipelines
- Share cached artifacts across runners for faster builds
- Monorepos
- Shared code across teams benefits from shared caches
- Game Studios
- Performance-sensitive teams already using Ninja
- Anyone
- Faster builds without changing your workflow
How It Works¶
graph LR
A[build.ninja] -->|Parse| B[rninja]
B -->|Check| C{Cache?}
C -->|Hit| D[Restore Artifacts]
C -->|Miss| E[Execute Build]
E --> F[Store in Cache]
D --> G[Done]
F --> G
- 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
Features¶
-
Flexible Configuration
Configure via files, environment variables, or CLI flags. Sensible defaults that work out of the box.
-
Powerful Subtools
All ninja subtools plus extras for cache management, dependency inspection, and debugging.
-
Daemon Mode
Long-running daemon caches parsed manifests for even faster subsequent builds.
-
Build Tracing
Chrome trace output for detailed build profiling and performance analysis.
Get Started¶
-
Get rninja running in 5 minutes
-
Learn about all features and options
-
Configure local and remote caches
-
Integrate rninja into your pipelines
Built with Rust by Neul Labs