Distributed build cache for Rust using NativeLink's Remote Execution API
- Rust 100%
objfs
Distributed build cache for Rust using the Remote Execution API v2.
Features
- Distributed caching -- Share build artifacts across machines
- Remote execution -- Compile on worker machines, link locally
- Auto-worker registration -- Every machine contributes to the cluster
- C/C++ support -- Cache GCC and Clang compilations via
objfs-cc-wrapper
Installation
cargo install --git https://github.com/nnunley/objfs
This installs three binaries: objfs, cargo-objfs-rustc, and objfs-cc-wrapper.
objfs intercepts rustc through Cargo's wrapper mechanism. No code changes required.
Usage
# Initialize a project
objfs init
# Local caching (zero config)
cargo build --release
# Shared cluster
export OBJFS_REMOTE_ENDPOINT="http://build-server:50051"
cargo build
See USAGE.md for configuration, CI/CD setup, and C/C++ integration.
How It Works
Developer Machines --> NativeLink Scheduler --> Worker Pool
|
CAS (artifacts) + AC (cache)
cargo-objfs-rustcintercepts eachrustcinvocation- Computes a cache key from source files and flags
- Checks the local cache, then the shared remote cache
- On a miss, submits the build to the scheduler or compiles locally
- Stores the result for reuse by any machine in the cluster
Documentation
Guides:
- Remote Execution -- Distributed builds
- Worker Setup -- NativeLink worker configuration
- CI/CD Integration -- GitHub Actions, GitLab CI
- C/C++ Integration -- CMake, Make builds
Reference:
- Architecture -- Technical details
- Linking Strategy -- Platform-compatible linking
- Auto-Worker Registration -- Zero-config clustering
- Roadmap -- C/C++ feature tracking
License
MIT