Skip to content

C++ compilation of rule '//src/main/tools:linux-sandbox' failed #2057

@linrio

Description

@linrio

Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.

Description of the problem / feature request / question:

I manage to compile bazel from source, and I follow the Documentation. But I got the error:

If possible, provide a minimal example to reproduce the problem:

[llf@k20-1 bazel]$ ./compile.sh 
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh compile /path/to/bazel
馃崈  Building Bazel from scratch.......
馃崈  Building Bazel with Bazel.
.WARNING: /tmp/bazel_PzOTkjF2/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_PzOTkjF2/out/external/bazel_tools/WORKSPACE (@io_bazel) does not match the name given in the repository's definition (@bazel_tools); this will cause a build error in future versions.
INFO: Found 1 target...
ERROR: /home/llf/support/bazel/src/main/tools/BUILD:19:1: C++ compilation of rule '//src/main/tools:linux-sandbox' failed: process-wrapper failed: error executing command 
  (cd /tmp/bazel_PzOTkjF2/out/bazel-sandbox/d6b121ed-adbe-4321-84b0-6ef25aee0916-6/execroot/bazel && \
  exec env - \
    LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64:/usr/local/cuda-7.5/lib64: \
    PATH=:/llf/usr/local/gmp/include:/llf/usr/local/mpfr/include:/home/llf/usr/local/include:/usr/include:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/home/llf/usr/local/python/bin:/home/llf/usr/local/gmp/bin:/home/llf/usr/local/bazel/bin \
  /tmp/bazel_PzOTkjF2/out/execroot/bazel/_bin/process-wrapper -1 5 - - /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/local-opt/bin/src/main/tools/_objs/linux-sandbox/src/main/tools/linux-sandbox.d '-frandom-seed=bazel-out/local-opt/bin/src/main/tools/_objs/linux-sandbox/src/main/tools/linux-sandbox.o' -iquote . -iquote bazel-out/local-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local-opt/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/main/tools/linux-sandbox.cc -o bazel-out/local-opt/bin/src/main/tools/_objs/linux-sandbox/src/main/tools/linux-sandbox.o).
src/main/tools/linux-sandbox.cc: In function 'void CloseFds()':
src/main/tools/linux-sandbox.cc:104: error: 'nullptr' was not declared in this scope
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-free-nonheap-object"
Target //src:bazel failed to build
INFO: Elapsed time: 3.775s, Critical Path: 0.73s

ERROR: Could not build Bazel

How to address this problem?

Environment info

  • Operating System:
Linux k20-1 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

*Java version:

Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

*GCC version:

[llf@k20-1 support]$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.

*G++ version:

[llf@k20-1 support]$ g++ --version
g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.
  • Bazel version (output of bazel info release):
[llf@k20-1 support]$ bazel info release
/home/llf/usr/local/bazel/bin/bazel: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/llf/usr/local/bazel/bin/bazel)
/home/llf/usr/local/bazel/bin/bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by /home/llf/usr/local/bazel/bin/bazel)
/home/llf/usr/local/bazel/bin/bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by /home/llf/usr/local/bazel/bin/bazel)
/home/llf/usr/local/bazel/bin/bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /home/llf/usr/local/bazel/bin/bazel)
/home/llf/usr/local/bazel/bin/bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.19' not found (required by /home/llf/usr/local/bazel/bin/bazel)

I copy the sound code from git clone https://github.com/bazelbuild/bazel.git . Is it the latest version?

  • If bazel info release returns "development version" or "(@Non-Git)", please tell us what source tree you compiled Bazel from; git commit hash is appreciated (git rev-parse HEAD):

Have you found anything relevant by searching the web? (e.g. GitHub issues, email threads in the bazel-discuss@googlegroups.com archive)

#1900 #583

Anything else, information or logs or outputs that would be helpful?

(If they are large, please upload as attachment or provide link).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions