Skip to content

Move bazel.rc to workspace root to support bazel-0.18.0 - #21374

Merged
tensorflow-copybara merged 2 commits into
tensorflow:masterfrom
perfinion:bazel
Oct 2, 2018
Merged

tensorflow-copybara merged 2 commits into
tensorflow:masterfrom
perfinion:bazel

Conversation

@perfinion

Copy link
Copy Markdown
Member

Bazel 0.17.0 will contain a change for which rc files it accepts.
bazelbuild/bazel@ec83598
bazelbuild/bazel#4502

Old bazel used to read %workspace%/tools/bazel.rc. New bazel will not
read that and instead will only read %workspace%/.bazelrc.

Signed-off-by: Jason Zaman [email protected]

Also updates bazel rules_closure to the latest and changes ./configure to echo a workspace relative path instead of full path in case the .bazelrc accidentally gets committed.

@perfinion

Copy link
Copy Markdown
Member Author

There is a fatal error if the .bazelrc imports a .tf_configure.bazelrc that does not exist. I will open a bazel issue to make it nonfatal.

Changing the import to workspace-relative should make things a little better, but care will still need to be taken to ensure that the import is not accidentally committed to the file anyway.

$ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
[bazel INFO src/main/cpp/option_processor.cc:203] Looked for a system bazelrc at path '/etc/bazel.bazelrc', but none was found.
[bazel INFO src/main/cpp/option_processor.cc:259] Looking for master bazelrcs in the following three paths: /home/jason/code/venv/tf/tensorflow/tools/bazel.rc, , 
[bazel INFO src/main/cpp/rc_file.cc:53] Parsing the RcFile /home/jason/code/venv/tf/tensorflow/.bazelrc
[bazel INFO src/main/cpp/rc_file.cc:53] Parsing the RcFile /home/jason/code/venv/tf/tensorflow/.tf_configure.bazelrc
[bazel FATAL src/main/cpp/blaze.cc:1271] Unexpected error reading .blazerc file '/home/jason/code/venv/tf/tensorflow/.tf_configure.bazelrc'

@perfinion

Copy link
Copy Markdown
Member Author

Filed: bazelbuild/bazel#5765

@case540

case540 commented Aug 6, 2018

Copy link
Copy Markdown
Contributor

Thanks for the PR! One question.

Why do we have to update io_bazel_rules_closure in WORKSPACE file for this change?

@perfinion

Copy link
Copy Markdown
Member Author

@case540 oh, i guess we dont. I just saw it was out of date and updated it. Do you want me to remove that commit and make a separate PR for that?

@case540

case540 commented Aug 7, 2018

Copy link
Copy Markdown
Contributor

Yeah, please remove that change from this PR. Only create a separate PR if there is a very specific reason you need to update the dependency. Thanks again

@case540 case540 added the stat:awaiting response Status - Awaiting response from author label Aug 9, 2018
@perfinion

Copy link
Copy Markdown
Member Author

@case540 done. but maybe we want to wait till bazel decides on how they want to name things before merging this?

@case540

case540 commented Aug 9, 2018

Copy link
Copy Markdown
Contributor

Sounds good to me.

@tensorflowbutler

Copy link
Copy Markdown
Member

Nagging Assignee @case540: It has been 20 days with no activity and this issue has an assignee. Please update the label and/or status accordingly.

@perfinion perfinion changed the title Move bazel.rc to workspace root to support bazel-0.17.0 Move bazel.rc to workspace root to support bazel-0.18.0 Aug 31, 2018
@perfinion

Copy link
Copy Markdown
Member Author

Rebased to quiet the bot. The rc file change was rolled back for bazel-0.17 and will be in 0.18 instead so gotta wait a little more so we get the new syntax right.

@meteorcloudy

Copy link
Copy Markdown
Member

Any progress on this? We also need this change to fix TensorFlow failure with Bazel@HEAD on our CI.
Please see bazelbuild/bazel#5945

@perfinion

Copy link
Copy Markdown
Member Author

@meteorcloudy when will try-import hit a released version of Bazel? Once I update ./configure to use try-import it'll also need to have the minimum required version set higher too so I was thinking to do this only once bazel is released? Having people use bazel from git is a bunch more complicated.

@perfinion

Copy link
Copy Markdown
Member Author

Or should I just do this change first using import then we change to try-import a bit later? (but not too long)

@meteorcloudy

Copy link
Copy Markdown
Member

Hi @perfinion , thanks for working on this.
try-import should be available from 0.18.0, since 0.17.0 is still not out yet, we might have to wait a few more weeks.
I think we can do this change first if you think it's ok.

@perfinion

Copy link
Copy Markdown
Member Author

@meteorcloudy my main concern is if people accidentally commit anything weird in the /.bazelrc file. Everyone will just have to be careful to make sure the import line does not get committed to the file until we switch to try-import.

@martinwicke @yifeif Can we make one of the test bots double check the .bazelrc line to confirm no PR accidentally commits the "import %workspace%/.bazelrc" line? Or if the sanity stuff is in the tree somewhere i'll add a commit to update that together.

@gunan
gunan requested a review from meteorcloudy September 16, 2018 19:47
@meteorcloudy meteorcloudy added the kokoro:force-run Tests on submitted change label Sep 17, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Sep 17, 2018
@meteorcloudy

meteorcloudy commented Sep 17, 2018 •

Copy link
Copy Markdown
Member

Is the test failure related to this change?

@perfinion

Copy link
Copy Markdown
Member Author

rebased and updated commit messages to 0.18.0 from 0.17.0

meteorcloudy
meteorcloudy previously approved these changes Sep 18, 2018

@meteorcloudy meteorcloudy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@meteorcloudy meteorcloudy added the kokoro:force-run Tests on submitted change label Sep 18, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Sep 18, 2018
@perfinion perfinion added the ready to pull PR ready for merge process label Sep 18, 2018
@perfinion

Copy link
Copy Markdown
Member Author

@case540 @meteorcloudy looks like the auto-import failed, you'll have to do it manually i think

@meteorcloudy

Copy link
Copy Markdown
Member

@case540 Can you help importing this change?

@case540 case540 added ready to pull PR ready for merge process and removed ready to pull PR ready for merge process labels Sep 19, 2018
@case540

case540 commented Sep 19, 2018

Copy link
Copy Markdown
Contributor

huh, no idea why import/copybara isnt running properly. Yeah, I can handle importing this.

@case540

case540 commented Sep 22, 2018

Copy link
Copy Markdown
Contributor

Didnt forget about this. Will hopefully have this PR pulled internally over the weekend. Just needs some internal update due to the way our migration scripts work (this PR removes an opensource-only file).

@perfinion

Copy link
Copy Markdown
Member Author

@case540 thanks for the help! is there also something you can add (to the sanity bot maybe?) to flag if a PR accidentally commits the "import %workspace%/.bazelrc" line until we get the try-import stuff?
Otherwise it shouldn't be too long before 0.18.0 is out so we can just keep an eye on it carefully.

@perfinion

Copy link
Copy Markdown
Member Author

@case540 Do you want me to rebase and fix the conflicts? or is it already in the queue?

@case540

case540 commented Sep 27, 2018

Copy link
Copy Markdown
Contributor

Yes, could you fix the conflicts please. I tried to merge this in this morning and hit a bunch of random errors.

Bazel 0.18.0 will contain a change for which rc files it accepts.
bazelbuild/bazel@ec83598
bazelbuild/bazel#4502

Old bazel used to read %workspace%/tools/bazel.rc. New bazel will not
read that and instead will only read %workspace%/.bazelrc.

Signed-off-by: Jason Zaman <[email protected]>
/.bazelrc is not gitignored anymore so this should help in case the
import line is accidentally committed. Bazel 0.18.0 will support a new
'try-import' statement that should be used once 0.18.0 has been out long
enough.

Signed-off-by: Jason Zaman <[email protected]>
@perfinion

Copy link
Copy Markdown
Member Author

@case540 done :)

@perfinion perfinion added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process and removed ready to pull PR ready for merge process labels Sep 28, 2018
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Sep 28, 2018
@tensorflow-copybara
tensorflow-copybara merged commit d3f6b72 into tensorflow:master Oct 2, 2018
tensorflow-copybara pushed a commit that referenced this pull request Oct 2, 2018
PiperOrigin-RevId: 215483141
@perfinion
perfinion deleted the bazel branch October 3, 2018 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes ready to pull PR ready for merge process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants