bazel remote executor--- buildfarm

Posted cjyp

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

  GCC 8 on Ubuntu 16.04

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-8 g++-8
gcc-8 --version

  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:
[email protected]_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?

 

 

以上是关于bazel remote executor--- buildfarm的主要内容,如果未能解决你的问题,请参考以下文章

python+selenium Remote 启动firefox报错总结

[bazel]-tulsi的使用

Bazel安装及使用入门

Bazel 编译工具 学习

#yyds干货盘点#Bazel与Gradle工具差异

版本问题---Bazel与tensorflow的对应关系