Skip to content

Conversation

@bmd3k
Copy link
Contributor

@bmd3k bmd3k commented Aug 14, 2020

  • Motivation for features / changes

We were asked to help with an internal Large Scale Change (Googlers, see b/163558320). Some excerpts:

Migrate genrules that use a Python 3 tool from tools to exec_tools.

genrule.tools uses blaze's host mode and forces to be Python 2, ignoring the py_binary.python_version attribute.

This CL corrects the use of the Python 3 tool so that it runs Python 3 instead of Python 2 by using exec_tools (if there are
no upstream host dependencies).

Difference between tools and exec_tools:

genrule.tools uses host mode, which ignores the py_binary.python_version attribute and always use Python 2 (to be
changed to Python 3)
genrule.exec_tools uses exec mode, which respects the py_binary.python_version attribute (unless an upstream host
dependency forces all downstream targets to stay in host)

It's not clear to me if these limitations apply to bazel as well but given these targets are also built internally we do need to perform the change.

  • Detailed steps to verify changes work correctly (as executed by you)

Make the changes; Run the following commands:

$ bazel clean
$ bazel build tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin/views/inactive:gen_inactive_component.ng.html
$ bazel build tensorboard/components_polymer3/polymer:gen_plottable_style
$ bazel build tensorboard/components/tensor_widget:gen_tensor_widget_style
$ bazel build tensorboard/plugins/debugger_v2/tf_debugger_v2_plugin:generate_dtypes

@bmd3k bmd3k marked this pull request as ready for review August 14, 2020 14:36
@bmd3k bmd3k requested a review from nfelt August 14, 2020 14:36
@bmd3k bmd3k merged commit 404bfa7 into tensorflow:master Aug 17, 2020
@bmd3k bmd3k deleted the exec-tools-for-python branch October 7, 2020 13:11
JamesHollyer added a commit that referenced this pull request Mar 15, 2023
* Motivation for features / changes
This is part of an internal Large Scale Change(googlers see
b/265933639).

In pr #4031 we switch from using the tools(host mode) to using
exec_tools(exec mode). This was done as part of a Large Scale
change(Googlers see b/163558320). This was always supposed to be a
temporary measure until the host mode was switched to use python3 by
default. That has now happened so we are switching back to using
genrule.tools.

* Technical description of changes
For reference, the difference between host and exec mode:
genrule.tools uses host mode, which ignores the py_binary.python_version
attribute and always use Python 3
genrule.exec_tools uses exec mode, which respects the
py_binary.python_version attribute (unless an upstream host
dependency forces all downstream targets to stay in host)

* Detailed steps to verify changes work correctly (as executed by you)
bazel clean
bazel build tensorboard/components/tensor_widget:gen_tensor_widget_style
bazel build tensorboard/components_polymer3/polymer:gen_plottable_style 
bazel build tensorboard/components/polymer:gen_plottable_style
yatbear pushed a commit to yatbear/tensorboard that referenced this pull request Mar 27, 2023
…low#6238)

* Motivation for features / changes
This is part of an internal Large Scale Change(googlers see
b/265933639).

In pr tensorflow#4031 we switch from using the tools(host mode) to using
exec_tools(exec mode). This was done as part of a Large Scale
change(Googlers see b/163558320). This was always supposed to be a
temporary measure until the host mode was switched to use python3 by
default. That has now happened so we are switching back to using
genrule.tools.

* Technical description of changes
For reference, the difference between host and exec mode:
genrule.tools uses host mode, which ignores the py_binary.python_version
attribute and always use Python 3
genrule.exec_tools uses exec mode, which respects the
py_binary.python_version attribute (unless an upstream host
dependency forces all downstream targets to stay in host)

* Detailed steps to verify changes work correctly (as executed by you)
bazel clean
bazel build tensorboard/components/tensor_widget:gen_tensor_widget_style
bazel build tensorboard/components_polymer3/polymer:gen_plottable_style 
bazel build tensorboard/components/polymer:gen_plottable_style
dna2github pushed a commit to dna2fork/tensorboard that referenced this pull request May 1, 2023
…low#6238)

* Motivation for features / changes
This is part of an internal Large Scale Change(googlers see
b/265933639).

In pr tensorflow#4031 we switch from using the tools(host mode) to using
exec_tools(exec mode). This was done as part of a Large Scale
change(Googlers see b/163558320). This was always supposed to be a
temporary measure until the host mode was switched to use python3 by
default. That has now happened so we are switching back to using
genrule.tools.

* Technical description of changes
For reference, the difference between host and exec mode:
genrule.tools uses host mode, which ignores the py_binary.python_version
attribute and always use Python 3
genrule.exec_tools uses exec mode, which respects the
py_binary.python_version attribute (unless an upstream host
dependency forces all downstream targets to stay in host)

* Detailed steps to verify changes work correctly (as executed by you)
bazel clean
bazel build tensorboard/components/tensor_widget:gen_tensor_widget_style
bazel build tensorboard/components_polymer3/polymer:gen_plottable_style 
bazel build tensorboard/components/polymer:gen_plottable_style
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants