Quick Start¶
This guide gets you from zero to your first cached build in under 5 minutes.
Prerequisites¶
- Rust toolchain (for installation)
- An existing project with a
build.ninjafile (or a build generator like CMake)
Step 1: Install rninja¶
Verify the installation:
Step 2: Run Your First Build¶
Navigate to a project directory containing a build.ninja file:
That's it!
rninja reads your existing build.ninja file with no configuration needed.
If your project uses CMake, Meson, or another generator:
Step 3: Experience Cached Builds¶
Run the build again without changes:
Expected output:
Now clean and rebuild:
Cache Hit
Notice how the rebuild is much faster? rninja restored cached artifacts instead of recompiling everything.
Step 4: Check Cache Statistics¶
View your cache status:
Example output:
Cache Statistics:
Enabled: true
Mode: local
Directory: /home/user/.cache/rninja
Local Cache:
Total entries: 42
Total size: 128.5 MB
Hit rate: 95.2%
Step 5: Enable Verbose Mode (Optional)¶
See what rninja is doing:
Common Workflows¶
Building Specific Targets¶
Parallel Builds¶
Different Build Directories¶
# Build in a different directory
rninja -C out/Release
# Use a different build file
rninja -f custom.ninja
Dry Run¶
See what would be built without actually building:
What's Next?¶
You now have rninja working with local caching. Here are some next steps:
-
Step-by-step tutorial with a sample project
-
Full guide for teams switching from Ninja
-
Share cache across your team
-
Customize rninja for your workflow
Quick Reference¶
| Task | Command |
|---|---|
| Build default targets | rninja |
| Build specific target | rninja target_name |
| Build in directory | rninja -C path/to/build |
| Parallel jobs | rninja -j8 |
| Verbose output | rninja -v |
| Dry run | rninja -n |
| Clean build outputs | rninja -t clean |
| Show cache stats | rninja -t cache-stats |
| List all tools | rninja -t list |
| Show dependencies | rninja -t deps target |
| Generate compile_commands.json | rninja -t compdb |