How to prevent Bazel from rebuilding every time after changing environments? #368
ubgk
started this conversation in
Tips and tricks
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
With our existing
.bazelrc
configuration, the build cache is invalidated every time youbazel build
in a different environment, such as when changing between conda environments or even between different terminals (e.g. VSCode and your default terminal application).There is an option in bazel incompatible_strict_action_env which normalises your
PATH
variable such that it is not inherited from the host.If your builds do not depend on specific
PATH
values (e.g. if you don't use conda installed compilers), you can pass this flag in your commands, or even add it to your.bazelrc
to prevent Bazel from rebuilding every time yourPATH
changes, e.g.:Beta Was this translation helpful? Give feedback.
All reactions