I’m trying to integrate bazel into a Linux distro packaging system.
Since bazel does not interpret commonly-used environment variables like $CFLAGS
, and since its sandbox interferes with wrappers such as ccache/distcc, I find myself in need to pass numerous command-line options to bazel.
To keep command-lines short, and to keep it transparent wrt. existing bazel calls in build scripts, I decided that it would be better to write those autogenerated command-line options to bazelrc, which will be then read automatically.
However, I would like to avoid clobbering ~/.bazelrc
or /etc/bazel.bazelrc
. As such, is there any way to control the location of bazelrc file using an environment variable or any other method transparent to the bazel invocation (i.e. without changing the command line)?