Skip to content

Fix issue of branch switching not working with bazel - #16196

Merged
case540 merged 3 commits into
tensorflow:masterfrom
yongtang:15957-branch-switch
Jan 19, 2018
Merged

case540 merged 3 commits into
tensorflow:masterfrom
yongtang:15957-branch-switch

Conversation

@yongtang

Copy link
Copy Markdown
Member

This fix tries to address the issue raised in #15957 where bazel stops working after switching git branch, and reconfigure with ./configure will not work as well.

This fix adds a quick fix as was suggested, by having export TF_CONFIG_TIME="$(date)" in configure.py and add it to the environ list in git_configure.bzl.

This fix fixes #15957.

Signed-off-by: Yong Tang [email protected]

@case540

case540 commented Jan 19, 2018

Copy link
Copy Markdown
Contributor

Another fix, which I pretty sure will work, is tell Bazel within the repo rule that it depends on .git/HEAD. Then whenever that file changes Im pretty sure the repo rule should be rerun. I think you can add something like...

r = repository_ctx.execute(["test", "-f", "%s/.git/logs/HEAD" % tensorflow_root_path])
if r.return_code == 0:
unused_var = repository_ctx.path(Label("//:.git/HEAD")) # pylint: disable=unused-variable

...to the git_configure repo rule.

This fix tries to address the issue raised in 15957 where
bazel stops working after switching git branch, and
reconfigure with `./configure` will not work as well.

This fix adds a quick fix as was suggested, by having
export TF_CONFIG_TIME="$(date)" in configure.py and add
it to the environ list in git_configure.bzl.

This fix fixes 15957.

Signed-off-by: Yong Tang <[email protected]>
@yongtang
yongtang force-pushed the 15957-branch-switch branch from a83f9e4 to 5410ef8 Compare January 19, 2018 19:11
@yongtang

Copy link
Copy Markdown
Member Author

@case540 Thanks for the help. I tested locally and it works as expected. The PR has been updated. Please take a look.

@case540 case540 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this :D

@case540
case540 merged commit e810b10 into tensorflow:master Jan 19, 2018
@yongtang
yongtang deleted the 15957-branch-switch branch January 19, 2018 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review Pull request awaiting review cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switching branch and run ./configure does not regenerate spec.json

4 participants