You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
```
Closesbazelbuild#12740.
PiperOrigin-RevId: 364407234
0 commit comments