bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Add %home% support for bazelrc imports

Open Gormo opened this issue 2 years ago • 1 comments

In CI environments with multiple bazel versions running on the same machine it is sometimes not possible to share ~/.bazelrc files between the versions.

This commit adds support for the %home% prefix when using import or try-import and allows the user to specify any bazelrc file relative to $HOME/.

Example workspace .bazelrc file: try-import %home%/.bazelrc_bazel_7

Gormo avatar Feb 21 '24 21:02 Gormo

While more narrow, I think this is still morally equivalent to https://github.com/bazelbuild/bazel/issues/10904#issuecomment-1726682327 and we should resolve the discussions/concerns there.

Is there some other well-known path you could stage these files? Could the CI system manage the RC files, or the args to specify them? Personally, I'm hesitant to add more, non-hermetic ways for bazelrc loading to look for files.

michajlo avatar Feb 23 '24 13:02 michajlo