Installation¶
rninja can be installed on Linux, macOS, and Windows. Choose the installation method that works best for your environment.
Requirements¶
- Rust toolchain (for installation via Cargo)
- Git (for building from source)
Installation Methods¶
From Crates.io (Recommended)¶
The simplest way to install rninja is via Cargo:
This installs the following binaries:
| Binary | Description |
|---|---|
rninja |
Main CLI (drop-in Ninja replacement) |
rninja-daemon |
Build daemon for faster subsequent builds |
rninja-cached |
Remote cache server |
From Source¶
To build from source with the latest changes:
# Clone the repository
git clone https://github.com/neul-labs/rninja
cd rninja
# Build and install
cargo install --path .
For development builds:
# Debug build (faster compilation, slower runtime)
cargo build
# Release build (slower compilation, faster runtime)
cargo build --release
Verifying Installation¶
After installation, verify rninja is working:
Expected output:
List available subtools:
Setting Up as Ninja Replacement¶
Option 1: Alias¶
Add to your shell configuration (~/.bashrc, ~/.zshrc, etc.):
Option 2: Symlink¶
Create a symlink so tools that call ninja use rninja:
Symlink Priority
If you already have Ninja installed, ensure the symlink location comes before Ninja in your PATH, or remove the original Ninja binary.
Option 3: Environment Variable¶
Some build systems respect environment variables:
# For CMake
export CMAKE_MAKE_PROGRAM=$(which rninja)
# Or configure CMake directly
cmake -DCMAKE_MAKE_PROGRAM=$(which rninja) ..
Platform-Specific Notes¶
Linux¶
rninja works on all modern Linux distributions. No special configuration needed.
macOS¶
rninja works on macOS 10.15 (Catalina) and later.
# Install Rust if needed
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Install rninja
cargo install rninja
Windows¶
rninja works on Windows 10 and later with the Rust toolchain installed.
# Install via Cargo
cargo install rninja
# Add to PATH if needed
$env:PATH += ";$env:USERPROFILE\.cargo\bin"
Installing Additional Components¶
Remote Cache Server¶
The remote cache server (rninja-cached) is installed automatically with the main package. To run it:
See Remote Cache Deployment for setup instructions.
Daemon¶
The daemon (rninja-daemon) is also installed automatically. It typically auto-starts when you run rninja, but can be managed manually:
See Daemon Management for details.
Updating rninja¶
To update to the latest version:
Or if you built from source:
Uninstalling¶
To remove rninja:
If you created a symlink:
Troubleshooting Installation¶
Cargo Not Found¶
If cargo is not found, install the Rust toolchain:
Build Fails¶
If the build fails, ensure you have the required build tools:
Permission Denied¶
If you get permission errors when creating symlinks:
# Use user-local directory instead
mkdir -p ~/.local/bin
ln -s $(which rninja) ~/.local/bin/ninja
# Add to PATH in your shell config
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Next Steps¶
-
Get your first build running
-
Configure rninja for your workflow