Repository navigation
Fix build issue when /usr/bin/python path is not available - #9547
Merged
Merged
Conversation
This fix tries to fix the build error where `PYTHON_BIN_PATH` is not used in `tf_version_info_genrule()` (which will cause build error if `python` is not available in the `PATH`). This could be an issue even if `python` is available yet a different python location is used in `./configure`. This fix fixes the issue by passing `$(PYTHON_BIN_PATH)` explicitly so that same python version could be used: ```udiff - "$(location //tensorflow/tools/git:gen_git_source.py) --generate $(SRCS) \"$@\"", + "$(PYTHON_BIN_PATH) $(location //tensorflow/tools/git:gen_git_source.py) --generate $(SRCS) \"$@\"", ``` See issue description: In one of the build machines (Ubuntu 16.04) only python3 is available (/usr/bin/python3) without python 2: ``` ubuntu@ubuntu:~/tensorflow$ python --version python: command not found ubuntu@ubuntu:~/tensorflow$ python3 --version Python 3.5.2+ ubuntu@ubuntu:~/tensorflow$ which python3 /usr/bin/python3 ``` After configure with `/usr/bin/python3`: ``` Please specify the location of python. [Default is /usr/bin/python3]: ... ``` The following is the error: ``` ubuntu@ubuntu:~/tensorflow$ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package WARNING: /home/ubuntu/tensorflow/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:exporter': Use SavedModel Builder instead. WARNING: /home/ubuntu/tensorflow/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:gc': Use SavedModel instead. INFO: Found 1 target... ERROR: /home/ubuntu/tensorflow/tensorflow/core/BUILD:1363:1: Executing genrule //tensorflow/core:version_info_gen failed: bash failed: error executing command /bin/bash -c ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127. /usr/bin/env: 'python': No such file or directory Target //tensorflow/tools/pip_package:build_pip_package failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 3.548s, Critical Path: 0.20s ``` Signed-off-by: Yong Tang <[email protected]>
Collaborator
|
Can one of the admins verify this patch? |
|
@tensorflow-jenkins test this please |
Merged
vrv
pushed a commit
to vrv/tensorflow
that referenced
this pull request
May 3, 2017
…ensorflow#9547)" This reverts commit 95f37eb.
vrv
pushed a commit
that referenced
this pull request
May 3, 2017
* Enable grappler to propagate shapes through queues.
Change: 154789133
* Add whitelist support in uid of RunConfig.
Change: 154794859
* Fix a bunch of bad links and missing docs in contrib.
Change: 154820641
* Don't try to refine the shapes for a node if its inference context wasn't
successfully built by the AddNode() method.
Change: 154838211
* Fix issue related to empty bazel.rc file.
Change: 154840138
* Remove overly precise CHECK when rendering debug output for a function.
An `_Arg` node can have more than three attrs, because the runtime may
(and does) add system-defined attrs (viz. "_output_shapes") that do
not change the meaning of the op.
Change: 154850526
* Port makefile build breakage
Change: 154855106
* [TF:XLA] Try to incorporate Tensorflow node structure for large HLO GraphDefs.
This change assumes that a TF subgraph/op does not cross the boundary of a HLO
computation and always put top-level TF subgraphs/ops under HLO computations.
Change: 154855884
* Added a unit test to check what happens when 2 shapes with known rank but
unknown dimensions are merged
Change: 154856675
* [XLA] Refactor constant folding operations into a dedicated module
Refactor constant folding operations into a dedicated module, and added a new
ReplaceInstruction() API to collapse { computation->ReplaceInstruction();
changed=true}.
Change: 154857025
* Java: Docs: Update instructions for Windows.
Inspired by
http://stackoverflow.com/questions/43741775/tensorflow-in-java-running-failed
Change: 154859066
* Add more documentation for features and labels.
Change: 154859649
* Added link to high-performance models
Change: 154860213
* Navigation and index for new performance section documents.
Change: 154862215
* Fix shape mismatch between loss and weights.
Change: 154862650
* Add examples to TensorShape documentation and ran autoformatter.
Change: 154862667
* Move linking of cudnn_plugin, cublas_plugin and cufft_plugin from
stream_executor to the ops that need them.
Change: 154863520
* Properly track the persistent memory usage of lookup tables.
Change: 154866686
* Reset the inputs to ShapeRefiner::RunShapeFn so that it behaves the same every time it's called.
To properly handle queues that have populated by several enqueue ops, merge the shapes of the inputs to all the enqueue ops before calling InferenceContext::set_output_handle_shape(). This ensures that we detect incorrect queue setups (where the 2 enqueue ops might generate tensors with incompatible shapes), and that we take all the known shape information instead of that of just one of the enqueue ops.
Change: 154866747
* Making sure an error message will be produced by session_manager when a non-tensor object is passed in.
Otherwise the 'name' property is missing.
Change: 154868022
* Don't needlessly synchronize the CUDA stream in CropAndResize.
Make the op Async so we don't block an executor thread while waiting for the result of the box bounds check to be copied back to the host.
Change: 154868460
* Add contribution guidelines and standards section to CONTRIBUTING.md
Several parts are largely based on the post by @yaroslavvb at: #7443#issuecomment-279182613
Fixes #7443
Change: 154876045
* Final draft
Change: 154876563
* Final draft
Change: 154876646
* Fix losses documentation.
Fix documentation of get_total_loss() to be correct.
And add a helpful comment about a common pitfall.
Change: 154876822
* [XLA] Second change for HLO interpreter.
Extends HloEvaluator to allow evaluation of HLO Computation or single HLO instruction
with non-constant operands, by traversing the instruction in post order and keeps track of
each instruction along the way as evaluated literals.
Change: 154877580
* [tf distributions] Move the remaining whitelisted distributions to core.
Change: 154878206
* Add shape to error message.
Change: 154880260
* Revert "Fix build issue when `/usr/bin/python` path is not available (#9547)"
This reverts commit 95f37eb.
|
@yongtang I had to revert this CL, because it turns out it broke with a parallel change to unhide the bazel.rc file -- this exposes a problem where PYTHON_BIN_PATH is not being exported in one of the android CI configurations (because it uses a 'sandboxed' build strategy). I think @andrewharp may be looking at what we can do here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix tries to fix the build error where
PYTHON_BIN_PATHis not used intf_version_info_genrule()(which will cause build error ifpythonis not available in thePATH).(See Ln 1188 in
tensorflow/tensorflow.bzl)This could be an issue even if
pythonis available yet a different python location is used in./configure.This fix fixes the issue by passing
$(PYTHON_BIN_PATH)explicitly so that same python version could be used:Below is the detailed issue description:
In one of the build machines (Ubuntu 16.04) only python3 is available
(/usr/bin/python3) without python 2:
After configure with
/usr/bin/python3through./configure:The following is the error:
Signed-off-by: Yong Tang [email protected]