Skip to content
This repository has been archived by the owner on Nov 28, 2021. It is now read-only.

Fails to build on arch linux with bazel version 0.5.3 #9

Closed
jfmyers9 opened this issue Aug 19, 2017 · 7 comments
Closed

Fails to build on arch linux with bazel version 0.5.3 #9

jfmyers9 opened this issue Aug 19, 2017 · 7 comments

Comments

@jfmyers9
Copy link
Contributor

jfmyers9 commented Aug 19, 2017

[jfmyers9@jfmyers9 cryptdo]$ bazel build //...
Extracting Bazel installation...
...........
WARNING: /home/jfmyers9/.cache/bazel/_bazel_jfmyers9/e98d2b9cb4b10236e6ed586e39086627/external/bazel_tools/tools/build_defs/pkg/pkg.bzl:196:9: pkg_tar: renaming non-dict `files` attribute to `srcs`.
ERROR: /home/jfmyers9/.cache/bazel/_bazel_jfmyers9/e98d2b9cb4b10236e6ed586e39086627/external/io_bazel_rules_go/go/tools/builders/BUILD:22:1: in go_tool_binary rule @io_bazel_rules_go//go/tools/builders:compile:
Traceback (most recent call last):
        File "/home/jfmyers9/.cache/bazel/_bazel_jfmyers9/e98d2b9cb4b10236e6ed586e39086627/external/io_bazel_rules_go/go/tools/builders/BUILD", line 22
                go_tool_binary(name = 'compile')
        File "/home/jfmyers9/.cache/bazel/_bazel_jfmyers9/e98d2b9cb4b10236e6ed586e39086627/external/io_bazel_rules_go/go/private/go_tool_binary.bzl", line 35, in _go_tool_binary_impl
                ctx.action(inputs = ((ctx.files.srcs + tool...), <4 more arguments>)
        File "/home/jfmyers9/.cache/bazel/_bazel_jfmyers9/e98d2b9cb4b10236e6ed586e39086627/external/io_bazel_rules_go/go/private/go_tool_binary.bzl", line 36, in ctx.action
                toolchain.tools
object of type 'Target' has no field 'tools'.
ERROR: Analysis of target '//cryptdopb:go_default_library' failed; build aborted.
INFO: Elapsed time: 98.510s
[jfmyers9@jfmyers9 cryptdo]$ bazel version
Build label: 0.5.3- (@non-git)
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Sat Aug 12 19:43:34 2017 (1502567014)
Build timestamp: 1502567014
Build timestamp as int: 1502567014
[jfmyers9@jfmyers9 cryptdo]$ uname -a
Linux jfmyers9 4.12.4-1-ARCH #1 SMP PREEMPT Fri Jul 28 18:54:18 UTC 2017 x86_64 GNU/Linux
@jfmyers9
Copy link
Contributor Author

jfmyers9 commented Aug 25, 2017

Extracting Bazel installation...
.............
WARNING: /home/pivotal/.cache/bazel/_bazel_pivotal/c0b28a16e7e4414bb9624b5648e7cb77/external/bazel_tools/tools/build_defs/pkg/pkg.bzl:196:9: pkg_tar: renaming non-dict `files` attribute to `srcs`
ERROR: /home/pivotal/.cache/bazel/_bazel_pivotal/c0b28a16e7e4414bb9624b5648e7cb77/external/io_bazel_rules_go/go/tools/builders/BUILD:41:1: in go_tool_binary rule @io_bazel_rules_go//go/tools/builders:generate_test_main:
Traceback (most recent call last):
        File "/home/pivotal/.cache/bazel/_bazel_pivotal/c0b28a16e7e4414bb9624b5648e7cb77/external/io_bazel_rules_go/go/tools/builders/BUILD", line 41
                go_tool_binary(name = 'generate_test_main')
        File "/home/pivotal/.cache/bazel/_bazel_pivotal/c0b28a16e7e4414bb9624b5648e7cb77/external/io_bazel_rules_go/go/private/go_tool_binary.bzl", line 35, in _go_tool_binary_impl
                ctx.action(inputs = ((ctx.files.srcs + tool...), <4 more arguments>)
        File "/home/pivotal/.cache/bazel/_bazel_pivotal/c0b28a16e7e4414bb9624b5648e7cb77/external/io_bazel_rules_go/go/private/go_tool_binary.bzl", line 36, in ctx.action
                toolchain.tools
object of type 'Target' has no field 'tools'
ERROR: Analysis of target '//cryptdopb:go_default_library_protos' failed; build aborted
INFO: Elapsed time: 23.398s
FAILED: Build did NOT complete successfully (29 packages loaded)
✓ master → uname -a
Linux bernal 4.4.0-92-generic #115-Ubuntu SMP Thu Aug 10 09:04:33 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
✓ master → bazel version
Build label: 0.5.4
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Aug 25 10:00:00 2017 (1503655200)
Build timestamp: 1503655200
Build timestamp as int: 1503655200

Also happens on ubuntu as well.

@xoebus
Copy link
Owner

xoebus commented Aug 29, 2017

This should be fixed by: 9a2c142. Make sure you are running the latest version of Bazel.

@jfmyers9
Copy link
Contributor Author

[jfmyers9@jfmyers9 cryptdo]$ bazel build //...
Extracting Bazel installation...
..........
INFO: Found 15 targets...
ERROR: /home/jfmyers9/.cache/bazel/_bazel_jfmyers9/e98d2b9cb4b10236e6ed586e39086627/external/org_golang_x_sys/unix/BUILD.bazel:3:1: Linking ../org_golang_x_sys/unix/go_default_library.cgo.dir/_all.o failed (Exit 1).
/usr/bin/ld.gold: fatal error: -pie and -r are incompatible
collect2: error: ld returned 1 exit status
INFO: Elapsed time: 167.756s, Critical Path: 12.95s
[jfmyers9@jfmyers9 cryptdo]$ bazel version
Build label: 0.5.4- (@non-git)
Build target: bazel-out/local-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Aug 29 01:47:12 2017 (1503971232)
Build timestamp: 1503971232
Build timestamp as int: 1503971232

I tried removing ~/.cache/bazel but that did not appear to help.

@xoebus
Copy link
Owner

xoebus commented Aug 29, 2017 via email

@jfmyers9
Copy link
Contributor Author

Adding --linkopt="-no-pie" to the bazel build command resulted in the following error:

[jfmyers9@jfmyers9 cryptdo]$ bazel build --linkopt="-no-pie" //...
INFO: Found 15 targets...
ERROR: /home/jfmyers9/workspace/local-gopath/src/github.com/xoebus/cryptdo/BUILD.bazel:12:1: error executing shell command: 'bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/build_tar --flagfile=bazel-out/local-fastbuild/bin/cryptdo.args' failed (Exit 1).
Traceback (most recent call last):
  File "/home/jfmyers9/.cache/bazel/_bazel_jfmyers9/e98d2b9cb4b10236e6ed586e39086627/bazel-sandbox/9023612678656145368/execroot/cryptdo/bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/build_tar.runfiles/cryptdo/../bazel_tools/tools/build_defs/pkg/build_tar.py", line 23, in <module>
    from third_party.py import gflags
  File "/home/jfmyers9/.cache/bazel/_bazel_jfmyers9/e98d2b9cb4b10236e6ed586e39086627/bazel-sandbox/9023612678656145368/execroot/cryptdo/bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/build_tar.runfiles/bazel_tools/third_party/py/gflags/__init__.py", line 1, in <module>
    from gflags import *
ModuleNotFoundError: No module named 'gflags'
INFO: Elapsed time: 2.147s, Critical Path: 0.67s

This error was fixed by running:

pip install python-gflags

Is this an expected dependency?

@xoebus
Copy link
Owner

xoebus commented Aug 29, 2017

No, it's not required on my system. I'll open an issue upstream to work out why it isn't using the vendored dependency.

@jfmyers9
Copy link
Contributor Author

As this fixed my issues on arch linux I'll close out this issue. We are seeing issues building in CI, but I'll investigate and open a new issue if its not clear. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants