forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support multiple --bazelrc on command line
Address bazelbuild#7489 ### Motivation Multiple --bazelrc on CLI would be useful for us for various reasons: Mostly importantly, we will have very long argument lists to pass to bazel query, so they have to be in a bazelrc file. `import/try import` in bazelrc would still work but very awkwardly. For example, if there are multiple bazelrc files to import, say `A` and `B`, import `A` needs to be added into `$WORKSPACE/.bazelrc` import `B` needs to be added into `A` meaning the former bazelrc file needs to know what comes next. Therefore allowing multiple --bazelrc would greatly improve the ergonomics, so the caller can create and append the new bazelrc without modifying the previous rc files. ### Note Options passed on CLI will still overwrite any options specified in any bazelrcs. ### Result `bazel --bazelrc=x.rc --bazelrc=y.rc ...` now works. ``` --bazelrc (a string; default: see description) The location of the user .bazelrc file containing default values of Bazel options. This option can also be chained together. E.g. `--bazelrc=x.rc --bazelrc=y.rc` so options in both RCs will be read. Note: `--bazelrc x.rc y.rc` is illegal, and each bazelrc file needs to be accompanied by --bazelrc flag before it. If unspecified, Bazel uses the first .bazelrc file it finds in the following two locations: the workspace directory, then the user's home directory. Use /dev/null to disable the search for a user rc file, e.g. in release builds. ``` Closes bazelbuild#12740. PiperOrigin-RevId: 364407234
- Loading branch information
1 parent
29e9369
commit 61da1d2
Showing
7 changed files
with
263 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters