Skip to content

Building NativeLink with Bazel

These instructions contain information on how to work with NativeLink for Bazel users.

If you’re using the Nix flake you’re all set.

If you’re running outside of nix, install bazelisk manually and make sure you have a recent functional C++ toolchain with LLD as linker.

Build

The following commands places an executable in ./bazel-bin/nativelink and starts the service:

Terminal window
bazel run nativelink -- \
$(pwd)/nativelink-config/examples/basic_cas.json

For optimized builds:

Terminal window
bazel run -c opt nativelink -- \
$(pwd)/nativelink-config/examples/basic_cas.json

Test

To run tests with Bazel:

Terminal window
bazel test //... --verbose_failures