码迷,mamicode.com
首页 > 其他好文 > 详细

bazel remote executor--- buildfarm

时间:2019-04-16 17:50:54      阅读:236      评论:0      收藏:0      [点我收藏+]

标签:lease   alter   ...   main   against   apollo   function   oss   ase   

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:
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?

 

 

bazel remote executor--- buildfarm

标签:lease   alter   ...   main   against   apollo   function   oss   ase   

原文地址:https://www.cnblogs.com/cjyp/p/10718558.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!