Single-Shot Mode¶
Run rninja without using the daemon process.
Overview¶
Single-shot mode (--no-daemon) runs builds directly without connecting to or spawning a daemon.
When to Use¶
Containers and Ephemeral Environments¶
In Docker or short-lived environments:
Daemon provides no benefit when the environment is destroyed after the build.
Debugging Build Issues¶
When isolating problems:
CI Single-Job Runners¶
For CI jobs that run one build and exit:
Resource-Constrained Systems¶
When memory for daemon is not available:
Scripted Builds¶
For predictable, isolated execution:
Usage¶
Basic¶
With Other Options¶
# Combine with any other flags
rninja --no-daemon -j8 -v my_target
rninja --no-daemon -C build/release
rninja --no-daemon -t clean
Environment Variable¶
Performance Comparison¶
| Metric | With Daemon | Single-Shot |
|---|---|---|
| First build | ~200ms + build | ~200ms + build |
| Subsequent builds | ~20ms + build | ~200ms + build |
| Memory baseline | 50-200 MB | 0 (process exits) |
When Daemon Helps¶
- Multiple builds in same session
- Interactive development
- IDE integration
When Daemon Doesn't Help¶
- Single builds (CI)
- Isolated environments
- Infrequent builds
Caching Still Works¶
Single-shot mode still uses the cache:
The cache is independent of the daemon.
CI Configuration Examples¶
GitHub Actions¶
GitLab CI¶
Docker Build¶
Makefile Integration¶
Comparison with Daemon Mode¶
Process Model¶
Daemon Mode:
Single-Shot Mode:
Resource Usage¶
Daemon Mode:
- Daemon process always running
- Consumes memory for cached state
- Faster subsequent builds
Single-Shot Mode:
- No persistent process
- Memory freed after build
- Consistent startup time
Troubleshooting¶
Build Slower in Single-Shot¶
Expected - daemon provides caching benefits:
Cache Not Working¶
Cache should work in both modes:
Want Daemon But Getting Single-Shot¶
Check for environment variables:
Best Practices¶
Use Single-Shot When:¶
- Running in containers
- CI single-job runners
- Debugging
- Scripts requiring predictability
Use Daemon When:¶
- Interactive development
- Multiple builds per session
- IDE integration
- Fast iteration cycles
Default Recommendation¶
Let rninja decide:
Specify only when you have a specific need: