Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tools/bazel.rc parsing #6319

Closed
dslomov opened this issue Oct 5, 2018 · 7 comments
Closed

Remove tools/bazel.rc parsing #6319

dslomov opened this issue Oct 5, 2018 · 7 comments
Assignees
Labels
incompatible-change Incompatible/breaking change P0 This is an emergency and more important than other current work. (Assignee required) type: feature request

Comments

@dslomov
Copy link
Contributor

dslomov commented Oct 5, 2018

Current documentation of how .bazerc files are parsed is here: https://docs.bazel.build/versions/master/user-manual.html#where-are-the-bazelrc-files

#6321 introduced a support for parsing tools/bazel.rc file to ease the transition.

How to migrate

(see the complete summary of changes in #6319 (comment))

%workspace%/tools/bazel.rc is replaced by %workspace%/.bazelrc. If you have the old file and want to support multiple versions of bazel - add the line import %workspace%/tools/bazel.rc at the top of your new .bazelrc file.

This file is in the same location as a file that used to be a "user-rc" (per-user configuration file for the project) - this is because it's the best place for it. If you have trouble transitioning though, because the user-rc was .gitignored, here is a suggestion for how to update your layout:

  • Move the old .bazelrc to user.bazelrc
  • Change the gitignore to ignoring that file.
  • Add the line try-import %workspace%/user.bazelrc
@dslomov dslomov added the incompatible-change Incompatible/breaking change label Oct 5, 2018
@dslomov dslomov self-assigned this Oct 5, 2018
@dslomov dslomov added P0 This is an emergency and more important than other current work. (Assignee required) type: feature request labels Oct 5, 2018
@katre
Copy link
Member

katre commented Oct 5, 2018

This is then also a release blocker for 0.19 (#6116).

@dslomov
Copy link
Contributor Author

dslomov commented Oct 5, 2018

This bug is actually not a release blocker for 0.18, #6321 is.
However this bug is indeed a blocker for 0.19

@katre
Copy link
Member

katre commented Oct 5, 2018

Once they are merged please comment on #6116 to let me know what the needed cherrypicks are. Thanks!

@cvcal
Copy link
Contributor

cvcal commented Oct 5, 2018

The old list of bazelrcs was, in order:

  • %workspace%/tools/bazel.rc (unless --nomaster_bazelrc)
  • %binary_dir%/bazel.bazelrc (unless --nomaster_bazelrc)
  • system rc, /etc/bazel.bazelrc or in %ProgramData% for Windows (unless --nomaster_bazelrc)
  • the first of the following gets called the "user" bazelrc
    • path passed by flag --bazelrc
    • %workspace%/.bazelrc
    • $HOME/.bazelrc

The new list is hopefully a bit more consistent, as:

  • system rc (unless --nosystem_rc) (same location as before)
  • workspace, %workspace%/.bazelrc (unless --noworkspace_rc)
  • user, $HOME/.bazelrc (unless --nohome_rc)
  • command-line provided, passed as --bazelrc or nothing if the flag is absent.

This means that the following rc's will be ignored from now on:

  • %workspace%/tools/bazel.rc
    1. This is replaced by %workspace%/.bazelrc. If you have the old file and want to support multiple versions of bazel - add the line import %workspace%/tools/bazel.rc at the top of your new .bazelrc file.
    2. Yes, this is in the same location as a file that used to be a "user-rc" - this is because it's the best place for it. If you have trouble transitioning though, because the user-rc was .gitignored, here is a suggestion for how to update your layout:
      1. Move the old .bazelrc to user.bazelrc
      2. Change the gitignore to ignoring that file.
      3. The workspace rc file, the new .bazelrc, can be checked in (and import tools/bazel.rc, if you need version compatibility as described above), and contain the line try-import %workspace%/user.bazelrc. This will allow users of this git project to optionally have the user rc, without erroring out for the users who do not need it.
  • %binary_dir%/bazel.bazelrc
    • There is no replacement for the binary rc - there wasn't much of a use case for that and the system rc should be sufficient, but if you were using it, please import that file into your system rc.

@dslomov
Copy link
Contributor Author

dslomov commented Oct 5, 2018

@katre Well actually this one is not a release blocker for 0.19 because that one is already cut. As long as you do not cherry-pick the fix for #6321 (don't), no action is needed.

However it is a release blocker for 0.20 (#6117)

pmuetschard added a commit to pmuetschard/gapid that referenced this issue Oct 15, 2018
pmuetschard added a commit to google/gapid that referenced this issue Oct 16, 2018
justinsb added a commit to justinsb/kops that referenced this issue Oct 18, 2018
See bazelbuild/bazel#6319

The default bazelrc location is changing.  So that we don't break
during the transition, we set up an alias so that bazel versions that
load from the new location are redirected to the old location.

Also add a TODO to move to the new location once bazel 0.18 is
prevalent.
justinsb added a commit to justinsb/kops that referenced this issue Oct 18, 2018
See bazelbuild/bazel#6319

The default bazelrc location is changing.  So that we don't break
during the transition, we set up an alias so that bazel versions that
load from the new location are redirected to the old location.

Also add a TODO to move to the new location once bazel 0.18 is
prevalent.
justinsb added a commit to justinsb/kops that referenced this issue Oct 18, 2018
See bazelbuild/bazel#6319

The default bazelrc location is changing.  So that we don't break
during the transition, we set up an alias so that bazel versions that
load from the new location are redirected to the old location.

Also add a TODO to move to the new location once bazel 0.18 is
prevalent.
ronshapiro added a commit to google/dagger that referenced this issue Oct 22, 2018
We can just move the old file to the new location once we're building exclusively with 0.19, but that's not yet released and we don't support it yet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217917383
ronshapiro added a commit to google/dagger that referenced this issue Oct 22, 2018
We can just move the old file to the new location once we're building exclusively with 0.19, but that's not yet released and we don't support it yet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217917383
ronshapiro added a commit to google/dagger that referenced this issue Oct 23, 2018
We can just move the old file to the new location once we're building exclusively with 0.19, but that's not yet released and we don't support it yet.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=217917383
@sgreenstein
Copy link
Contributor

Where does the user rc reside on Windows?

jamiesnape pushed a commit to RobotLocomotion/drake-external-examples that referenced this issue Oct 30, 2018
meisterT added a commit to DOMjudge/checktestdata that referenced this issue Nov 14, 2018
justinsb added a commit to justinsb/etcd-manager that referenced this issue Nov 27, 2018
The search path changed in
bazelbuild/bazel#6319, move to the new
location.
This was referenced Dec 16, 2018
justinsb added a commit to justinsb/etcdadm that referenced this issue Aug 28, 2020
The search path changed in
bazelbuild/bazel#6319, move to the new
location.
justinsb added a commit to justinsb/etcdadm that referenced this issue Aug 28, 2020
The search path changed in
bazelbuild/bazel#6319, move to the new
location.
justinsb added a commit to justinsb/etcdadm that referenced this issue Aug 28, 2020
The search path changed in
bazelbuild/bazel#6319, move to the new
location.
justinsb added a commit to justinsb/etcdadm that referenced this issue Aug 29, 2020
The search path changed in
bazelbuild/bazel#6319, move to the new
location.
justinsb added a commit to justinsb/etcdadm that referenced this issue Aug 29, 2020
The search path changed in
bazelbuild/bazel#6319, move to the new
location.
justinsb added a commit to justinsb/etcdadm that referenced this issue Dec 4, 2020
The search path changed in
bazelbuild/bazel#6319, move to the new
location.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatible-change Incompatible/breaking change P0 This is an emergency and more important than other current work. (Assignee required) type: feature request
Projects
None yet
Development

No branches or pull requests

4 participants