Skip to content
Discussion options

You must be logged in to vote

Install Bazelisk. It allows you to have a bash script wrapper called tools/bazel (https://github.com/bazelbuild/bazelisk?tab=readme-ov-file#ensuring-that-your-developers-use-bazelisk-rather-than-bazel) that can set up your variables and then it calls Bazel. Because .bazelrc doesn't directly support environment variables, you can add your --sandbox_add_mount_pair via this mechanism. For example, you could even generate a new .bazelrc like:

tools/bazel file:

#!/bin/bash

root_path="$(realpath $(dirname $0)/../)" # getting the root path of your repository as we're in the `tools` folder now
GENERATED_BAZELRC=${root_path}/.generated.bazelrc

echo "build --sandbox_add_mount_pair=${HOME}/.netrc:…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bd-tkoolen
Comment options

Answer selected by bd-tkoolen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants