打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
bazel remote executor--- buildfarm
buildfarm  https://github.com/bazelbuild/bazel-buildfarm
git clone https://github.com/bazelbuild/bazel-buildfarm
This is the slack of bazel buildfarm and .... https://buildteamworld.slack.com/messages/DHW2MERAL/
According to the README, update the bazel 0.24.0. There may be much problem.
Below is successful case.

  Build label: 0.24.0
  gcc version 5.4.0

  build server:
  bazel build //src/main/java/build/buildfarm:buildfarm-server
  bazel-bin/src/main/java/build/buildfarm/buildfarm-server examples/server.config.example

  build worker:
  bazel build //src/main/java/build/buildfarm:buildfarm-worker
  bazel-bin/src/main/java/build/buildfarm/buildfarm-worker examples/worker.config.example

  build test:
  bazel build ... --spawn_strategy=remote --genrule_strategy=remote --remote_executor=192.168.4.74:8980
  bazel build ... --spawn_strategy=remote --genrule_strategy=remote --strategy=Javac=remote --remote_executor=192.168.4.74:8980

  Some useful debug:

  bazel build -s ...  print action step

  build:remote --experimental_execution_log_file=/tmp/exec1.log

  build:remote --build_event_text_file=/tmp/bep.txt

  bazel clean --expunge

  https://stackoverflow.com/questions/14788345/how-to-install-the-jdk-on-ubuntu-linux  install jdk

  hint:

In apollo docker:  the problem still exist.

Description of the problem / feature request:
Update bazel from 0.15.0 to 0.24.0, fails to build a simple c program. Linker ld.gold can not work well.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Steps:
mkdir -p a
cat > a/WORKSPACE << EOF
EOF
cat > a/BUILD <<EOF
package(default_visibility = ["//visibility:public"])
cc_test(
name = 'test',
srcs = [ 'test.cc' ],
)
EOF
cat > a/test.cc <<EOF
#include <iostream>
int main() { std::cout << "Hello test!" << std::endl; return 0; }
EOFOutput:
apollo@in_dev_docker:/apollo/ttt/a$ bazel build ...
Starting local Bazel server and connecting to it...
INFO: Analysed target //:test (18 packages loaded, 654 targets configured).
INFO: Found 1 target...
ERROR: /apollo/ttt/a/BUILD:2:1: Linking of rule '//:test' failed (Exit 1) gcc failed: error executing command /usr/bin/gcc -o bazel-out/k8-fastbuild/bin/test -Wl,-S '-fuse-ld=gold' -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -pass-exit-codes -Wl,@bazel-out/k8-fastbuild/bin/test-2.paramsUse --sandbox_debug to see verbose messages from the sandbox
/usr/bin/ld.gold: error: bazel-out/k8-fastbuild/bin/_objs/test/test.pic.o: unsupported reloc 42 against global symbol std::cout
/usr/bin/ld.gold: error: bazel-out/k8-fastbuild/bin/_objs/test/test.pic.o: unsupported reloc 42 against global symbol std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)
/usr/bin/ld.gold: error: bazel-out/k8-fastbuild/bin/_objs/test/test.pic.o: unsupported reloc 42 against global symbol std::ios_base::Init::~Init()
bazel-out/k8-fastbuild/bin/_objs/test/test.pic.o:test.cc:function main: error: unsupported reloc 42
bazel-out/k8-fastbuild/bin/_objs/test/test.pic.o:test.cc:function main: error: unsupported reloc 42
bazel-out/k8-fastbuild/bin/_objs/test/test.pic.o:test.cc:function __static_initialization_and_destruction_0(int, int): error: unsupported reloc 42
collect2: error: ld returned 1 exit status
Target //:test failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 3.697s, Critical Path: 0.20s
INFO: 1 process: 1 processwrapper-sandbox.
FAILED: Build did NOT complete successfullyWhat operating system are you running Bazel on?
uname -a
Linux in_dev_docker 4.13.0-36-generic #40~16.04.1-Ubuntu SMP Fri Feb 16 23:25:58 UTC 2018 x86_64 x86_64 x86_64 GNU/LinuxWhat's the output of bazel info release?
release 0.24.0##These are some things confuses me. ##
1. I find some infomations that the rules of bazel 0.24.0 get its bazelrc change. If I do not specify the bazelrc, it has a ruler to look for the bazelrc. Is there some options to print where bazel gets its bazelrc and its config? (https://github.com/bazelbuild/bazel/issues/6319)
2. Why does bazel use ld.gold to link the program? I do not specify the linker, so i wonder if bazel get this options from alternative bazelrc.
3. And on the other hand, is there some solutions to make ld.gold resolve reloc well?

 

 

来源:http://www.icode9.com/content-4-165701.html
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
class Conversion 编译时检查类型之间是否可以相互转换
SDL入门教程(一):3、MinGW 下的安装与设置
Fastx-toolkit安装及报错解决
GDB远程调试技术
分享一例测试环境下nginx+tomcat的视频业务部署记录
二维数组和二级指针的传递问题
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服