I am trying to build tensorflow from source code and error happed #5536

Closed
lixinyutfd opened this Issue Nov 11, 2016 · 12 comments

Comments

Projects
None yet
5 participants
@lixinyutfd

after :bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
Things happend like this:

WARNING: /home/lixinyu/tensorflow/tensorflow/tensorflow.bzl:477:26: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
WARNING: /home/lixinyu/tensorflow/tensorflow/tensorflow.bzl:490:24: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
WARNING: /home/lixinyu/.cache/bazel/_bazel_lixinyu/824013fbb9b22e08d948a2226491e595/external/protobuf/protobuf.bzl:90:19: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
WARNING: /home/lixinyu/.cache/bazel/_bazel_lixinyu/824013fbb9b22e08d948a2226491e595/external/protobuf/protobuf.bzl:96:28: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
ERROR: /home/lixinyu/tensorflow/tensorflow/python/BUILD:1044:1: in cc_library rule //tensorflow/python:tf_session_helper: non-test target '//tensorflow/python:tf_session_helper' depends on testonly target '//tensorflow/python:construction_fails_op' and doesn't have testonly attribute set.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted.
INFO: Elapsed time: 0.209s

I googled this but there is not a trustworthy answer to my issue

@sono-bfio

This comment has been minimized.

Show comment
Hide comment
@sono-bfio

sono-bfio Nov 11, 2016

Contributor

Running to the same thing error:
ERROR: /home/ubuntu/tensorflow/tensorflow/python/BUILD:1728:1: in cc_library rule //tensorflow/python:tf_session_helper: non-test target '//tensorflow/python:tf_session_helper' depends on testonly target '//tensorflow/python:construction_fails_op' and doesn't have testonly attribute set.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted.
INFO: Elapsed time: 2.693s

Ubuntu 14.04
Using: tf 11 (tagged commit)
Bazel Info

bazel version
Build label: 0.4.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Nov 2 17:54:14 2016 (1478109254)
Build timestamp: 1478109254
Build timestamp as int: 1478109254
Contributor

sono-bfio commented Nov 11, 2016

Running to the same thing error:
ERROR: /home/ubuntu/tensorflow/tensorflow/python/BUILD:1728:1: in cc_library rule //tensorflow/python:tf_session_helper: non-test target '//tensorflow/python:tf_session_helper' depends on testonly target '//tensorflow/python:construction_fails_op' and doesn't have testonly attribute set.
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted.
INFO: Elapsed time: 2.693s

Ubuntu 14.04
Using: tf 11 (tagged commit)
Bazel Info

bazel version
Build label: 0.4.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Nov 2 17:54:14 2016 (1478109254)
Build timestamp: 1478109254
Build timestamp as int: 1478109254
@sono-bfio

This comment has been minimized.

Show comment
Hide comment
@sono-bfio

sono-bfio Nov 11, 2016

Contributor

FYI - I just pulled master down and was able to build,
Fer ref:
tag v0.11.0 failed
tag v0.11.0rc2 failed

Contributor

sono-bfio commented Nov 11, 2016

FYI - I just pulled master down and was able to build,
Fer ref:
tag v0.11.0 failed
tag v0.11.0rc2 failed

@aselle

This comment has been minimized.

Show comment
Hide comment
@aselle

aselle Nov 11, 2016

Member

@lixinyutfd we can't really help you if you don't specify what operating system and version you are trying to build. Thanks @sono-bfio.

Member

aselle commented Nov 11, 2016

@lixinyutfd we can't really help you if you don't specify what operating system and version you are trying to build. Thanks @sono-bfio.

@lixinyutfd

This comment has been minimized.

Show comment
Hide comment
@lixinyutfd

lixinyutfd Nov 11, 2016

@aselle I am using ubantu 14.04 and 0-11-0 version.

@aselle I am using ubantu 14.04 and 0-11-0 version.

@gunan

This comment has been minimized.

Show comment
Hide comment
@gunan

gunan Nov 11, 2016

Member

@sono-bfio @lixinyutfd which bazel version are you using?
I think this can be caused by a bazel update.
There has been a non backwards compatible change in bazel.
Could you try with bazel 0.3.2 ?

Member

gunan commented Nov 11, 2016

@sono-bfio @lixinyutfd which bazel version are you using?
I think this can be caused by a bazel update.
There has been a non backwards compatible change in bazel.
Could you try with bazel 0.3.2 ?

@lixinyutfd

This comment has been minimized.

Show comment
Hide comment
@lixinyutfd

lixinyutfd Nov 11, 2016

@gunan I am using 0.40 for bazel.

@gunan I am using 0.40 for bazel.

@gunan

This comment has been minimized.

Show comment
Hide comment
@gunan

gunan Nov 11, 2016

Member

Then I am pretty certain it is with the bazel version.
Could you try with bazel 0.3.2?

Member

gunan commented Nov 11, 2016

Then I am pretty certain it is with the bazel version.
Could you try with bazel 0.3.2?

@lixinyutfd

This comment has been minimized.

Show comment
Hide comment
@lixinyutfd

lixinyutfd Nov 11, 2016

I did successfully just now .
What I did is just pull the new master of tensorflow and it worked.
I dont think this is caused by bazel @gunan
Athough there are lots of info and warning during compiling. Is such warning normal ones or shows something wrong?

I did successfully just now .
What I did is just pull the new master of tensorflow and it worked.
I dont think this is caused by bazel @gunan
Athough there are lots of info and warning during compiling. Is such warning normal ones or shows something wrong?

@gunan

This comment has been minimized.

Show comment
Hide comment
@gunan

gunan Nov 11, 2016

Member

@lixinyutfd It is caused by an update in bazel.
They used to not care about "testonly" attributes in BUILD files.
With 0.4, they now do. Due to them not caring about testonly attributes before, our code evolved in such a way that we imported our test helper libraries into our pip package, which is obviously not test only.
On master, we did make the fixes and removed most testonly libs from pip package, so it builds successfully with the latest bazel version. In older releases, we did not make that fix, so they do not build with bazel 0.4.

The compilation warnings are expected. INFO and WARNING messages are mostly benign.

Member

gunan commented Nov 11, 2016

@lixinyutfd It is caused by an update in bazel.
They used to not care about "testonly" attributes in BUILD files.
With 0.4, they now do. Due to them not caring about testonly attributes before, our code evolved in such a way that we imported our test helper libraries into our pip package, which is obviously not test only.
On master, we did make the fixes and removed most testonly libs from pip package, so it builds successfully with the latest bazel version. In older releases, we did not make that fix, so they do not build with bazel 0.4.

The compilation warnings are expected. INFO and WARNING messages are mostly benign.

@gunan gunan closed this Nov 11, 2016

@sono-bfio

This comment has been minimized.

Show comment
Hide comment
@sono-bfio

sono-bfio Nov 11, 2016

Contributor

Will try with bazel 0.3.2 and let you know how it goes.

Contributor

sono-bfio commented Nov 11, 2016

Will try with bazel 0.3.2 and let you know how it goes.

@jcarloseugenio

This comment has been minimized.

Show comment
Hide comment
@jcarloseugenio

jcarloseugenio Feb 18, 2017

Hi everyone,
I am looking for some help regarding the same error message. I haven't found the way to downgrade bazel to the version 0.3.2, I am doing :
root@tensorflow:~# sudo apt-get install bazel=0.3.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '0.3.2' for 'bazel' was not found

Below is my system configuration:

Tensorflow version:

tf.version
'1.0.0'

ARNING: /root/.cache/bazel/_bazel_root/ff219f214582e62419b9171e5b5ba9a0/external/protobuf/protobuf.bzl:90:19: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
WARNING: /root/.cache/bazel/_bazel_root/ff219f214582e62419b9171e5b5ba9a0/external/protobuf/protobuf.bzl:96:28: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
ERROR: infinite symlink expansion detected
[start of symlink chain]
/usr/local/lib/python2.7/dist-packages

Ubuntu version:
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

Bazel version:
Build label: 0.4.2
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Dec 7 18:47:11 2016 (1481136431)
Build timestamp: 1481136431
Build timestamp as int: 1481136431

Thanks

Hi everyone,
I am looking for some help regarding the same error message. I haven't found the way to downgrade bazel to the version 0.3.2, I am doing :
root@tensorflow:~# sudo apt-get install bazel=0.3.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '0.3.2' for 'bazel' was not found

Below is my system configuration:

Tensorflow version:

tf.version
'1.0.0'

ARNING: /root/.cache/bazel/_bazel_root/ff219f214582e62419b9171e5b5ba9a0/external/protobuf/protobuf.bzl:90:19: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
WARNING: /root/.cache/bazel/_bazel_root/ff219f214582e62419b9171e5b5ba9a0/external/protobuf/protobuf.bzl:96:28: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
ERROR: infinite symlink expansion detected
[start of symlink chain]
/usr/local/lib/python2.7/dist-packages

Ubuntu version:
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial

Bazel version:
Build label: 0.4.2
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Wed Dec 7 18:47:11 2016 (1481136431)
Build timestamp: 1481136431
Build timestamp as int: 1481136431

Thanks

@gunan

This comment has been minimized.

Show comment
Hide comment
@gunan

gunan Feb 21, 2017

Member

I realized I might be looking at the wrong error message above.
If you are trying to build 1.0 branch, any bazel version above 0.4.2 should work.
If you are trying to build an old branch, you can download an old version of bazel and install manually using the packages found here:
https://github.com/bazelbuild/bazel/releases

Member

gunan commented Feb 21, 2017

I realized I might be looking at the wrong error message above.
If you are trying to build 1.0 branch, any bazel version above 0.4.2 should work.
If you are trying to build an old branch, you can download an old version of bazel and install manually using the packages found here:
https://github.com/bazelbuild/bazel/releases

ojkelly added a commit to ojkelly/rules_go that referenced this issue Apr 4, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment