Reputation: 127
If I pull in an external Bazel project as a WORKSPACE dependency, and this project has a tools/bazel.rc that adds some default build options and defines some build --config options, how does this work exactly?
Are these default options used when building these external build targets? Can I pass the --config options defined in the external bazel.rc file when building targets in my project? Are there any best-practices for configuring the build of Bazel external WORKSPACE dependencies.
Also, is a .bazelrc written to the root of the external project picked up when building.
Just looking for clarification on how this works.
Upvotes: 7
Views: 1210
Reputation: 20520
For better or worse, Bazel's rc file finding logic is completely unaware of external repositories. So, Bazel will only look for a tools/bazel.rc
in your main workspace. If you need options from somewhere Bazel isn't looking, you'll need to copy them into your main workspace's rc file or explicitly specify the desired configuration file with --bazelrc
.
Upvotes: 2