Skip to content

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.

Get Started View on GitHub


  • 23x Faster No-op Builds


    Sub-millisecond detection when nothing needs rebuilding. No more waiting for build systems to check thousands of files.

    See benchmarks

  • Content-Addressed Caching


    BLAKE3 hashing ensures correct, reproducible builds. Automatic cache restoration for repeated builds.

    Learn about caching

  • Remote Cache Sharing


    Share build artifacts across your team and CI runners. Dramatically reduce CI build times with shared caches.

    Set up remote cache

  • Drop-in Compatible


    Works with existing .ninja files from CMake, Meson, GN, or any generator. No changes to your build configuration required.

    Migration guide


Quick Install

cargo install rninja
git clone https://github.com/neul-labs/rninja
cd rninja
cargo install --path .
# After installing rninja
ln -s $(which rninja) /usr/local/bin/ninja

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

Complete Quick Start Guide


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

View detailed benchmarks


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
  1. Parse your existing build.ninja file (no changes needed)
  2. Hash inputs, compiler flags, and environment
  3. Check cache for matching artifacts
  4. Build only what's actually changed
  5. Store results for next time

Architecture overview


Features

  • Flexible Configuration


    Configure via files, environment variables, or CLI flags. Sensible defaults that work out of the box.

    Configuration

  • Powerful Subtools


    All ninja subtools plus extras for cache management, dependency inspection, and debugging.

    Subtools

  • Daemon Mode


    Long-running daemon caches parsed manifests for even faster subsequent builds.

    Daemon

  • Build Tracing


    Chrome trace output for detailed build profiling and performance analysis.

    Profiling


Get Started


Built with Rust by Neul Labs

GitHub · Crates.io · MIT License