Bazel
Fabrik provides a wrapper command for Bazel that automatically configures remote caching via the Bazel Remote Caching protocol.
Usage
The fabrik bazel command is a drop-in replacement for the standard bazel command:
bash
# Instead of: bazel build //...
# Use:
fabrik bazel -- build //...All bazel arguments and flags work as normal:
bash
# Build a specific target
fabrik bazel -- build //src:myapp
# Run tests
fabrik bazel -- test //...
# Build with configuration
fabrik bazel -- build //... --config=release --jobs=8
# Query targets
fabrik bazel -- query 'deps(//...)'
# Clean build artifacts
fabrik bazel -- cleanHow It Works
When you run fabrik bazel, Fabrik:
- Starts a local gRPC server implementing the Bazel Remote Caching protocol
- Automatically injects the
--remote_cache=grpc://localhost:{port}flag - Passes through all your bazel arguments unchanged
- Handles graceful shutdown when the build completes
The local cache server implements the following gRPC services from the Bazel Remote APIs:
- ContentAddressableStorage (CAS): For storing and retrieving build artifacts (blobs) by content-addressed digest
- ActionCache: For caching action results (mapping action hashes to outputs)
- Capabilities: For advertising supported features to Bazel clients
Requirements
- Bazel must be installed and available in
PATH
See Also
- CLI Reference - Full command-line options
- Configuration File - Complete configuration reference
- Bazel Remote Caching Documentation - Official Bazel docs