Skip to content
rninja

Home / Features

Everything ninja does, plus the parts it leaves out

rninja keeps the format and the CLI and closes the gaps in the executor: a content-addressed cache, an async scheduler, and optional cross-machine sharing. Here is the full breakdown.

Drop-in compatibility

rninja is ninja where ninja works. Same format, same flags, nothing to migrate.

Same build.ninja format

rninja parses the exact build.ninja your generator emits — CMake, GN, Meson, or hand-written. It does not regenerate the file; it executes it, preserving phony, restat, pools, and depfiles.

Mirrors ninja core flags

The flags you already type work: -C, -f, -j, -k, -l, -n, -t, -v, -d. NINJA_STATUS is honored and exit codes match, so scripts and CI do not move.

All of ninja -t, plus extras

clean, compdb, graph, deps, and query behave like ninja. rninja adds -t config for inspecting or generating an rninja.toml and a stats view for cache hit rate.

Content-addressed caching

Hash every action over its real inputs. A hit is a guaranteed-equivalent artifact.

Local action cache

Every action is hashed over its inputs, command line, and observed environment. Identical inputs produce identical hashes, so repeat builds skip the toolchain entirely.

Crash-safe sled index

The cache index is backed by sled, so an interrupted build cannot corrupt the store. Restart and pick up where you left off.

Strictly additive correctness

A miss falls through to the original ninja action; a hit only happens when inputs, command, and environment all match. Caching never changes what a build produces.

Scheduling

Keep every core busy where stock ninja stalls on single-threaded bookkeeping.

Tokio-driven async executor

The scheduler moves bookkeeping off the hot path and keeps cores saturated, so the misses you do have to build finish sooner.

IO-aware ready queue

The ready queue accounts for IO contention, not just raw job count, so a graph that is disk-bound in places does not thrash the CPU.

Remote cache

Optional. Share content-addressed artifacts across laptops and CI runners.

async-nng transport

The optional remote cache streams blobs between machines over async-nng. One small endpoint can serve a whole team.

Fresh machines start warm

First builds on a new laptop or a clean CI runner become mostly cached builds once a peer has seeded the store with identical inputs.

Opt-in, local-first

Enabled via RNINJA_REMOTE_URL and RNINJA_CACHE_MODE. Leave it off and rninja is a purely local cache plus scheduler — the local store always front-runs the remote.

Install & operation

No daemon to register, no service to run. Sensible defaults out of the box.

Four package channels

Ships on crates.io (cargo install rninja), npm (rninja-cli), PyPI (rninja-cli), and Homebrew. Prebuilt binaries are on GitHub Releases.

Zero-config defaults

The cache lives under $XDG_CACHE_HOME/rninja. No daemon to install. RNINJA_* env vars exist for power users; everyone else gets the speedup for free.

MIT licensed

A memory-safe Rust implementation, MIT licensed, built by Neul Labs.

See it on your own build

Read how it works, follow the quickstart, or check the comparisons.