Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bazel compilation error on commit bb5901b #1837

Closed
is03wlei opened this issue Sep 27, 2016 · 3 comments
Closed

Bazel compilation error on commit bb5901b #1837

is03wlei opened this issue Sep 27, 2016 · 3 comments
Assignees
Labels
P1 I'll work on this now. (Assignee required) type: bug

Comments

@is03wlei
Copy link
Contributor

sh 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_XnUx9q4j/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_XnUx9q4j/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.
WARNING: /home/wangleikidding/bazel/tools/build_rules/java_rules_skylark.bzl:185:13: Variables HOST_CFG and DATA_CFG are deprecated in favor of strings "host" and "data" correspondingly.
INFO: Found 1 target...
INFO: From Compiling src/main/tools/build-runfiles.cc:
src/main/tools/build-runfiles.cc: In member function 'void RunfilesCreator::EnsureDirReadAndWritePerms(const std::string&)':
src/main/tools/build-runfiles.cc:359: warning: comparison between signed and unsigned integer expressions
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-free-nonheap-object"
ERROR: /home/wangleikidding/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_XnUx9q4j/out/bazel-sandbox/4dcd5fba-044b-4fff-8c12-353ea79e89fc-12/execroot/bazel &&
exec env -
PATH=/data/hadoop/opbin:/usr/local/jdk1.8.0_77/bin:/data/hadoop/hadoop-2.7.2/bin:/data/hadoop/hive/bin:/data/hadoop/hadoop-2.7.2/sbin:/data/hadoop/soft/scala-2.9.1.final/bin:/data/hadoop/spark/bin:/data/hadoop/apache-maven-3.3.9/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/go/bin/:/root/bin:/usr/local/go/bin/:/home/wangleikidding/bin
/tmp/bazel_XnUx9q4j/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-pid1.d '-frandom-seed=bazel-out/local-opt/bin/src/main/tools/objs/linux-sandbox/src/main/tools/linux-sandbox-pid1.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-pid1.cc -o bazel-out/local-opt/bin/src/main/tools/objs/linux-sandbox/src/main/tools/linux-sandbox-pid1.o).
src/main/tools/linux-sandbox-pid1.cc: In function 'void MountFilesystems()':
src/main/tools/linux-sandbox-pid1.cc:240: error: expected initializer before ':' token
src/main/tools/linux-sandbox-pid1.cc:633: error: expected primary-expression at end of input
src/main/tools/linux-sandbox-pid1.cc:633: error: expected ';' at end of input
src/main/tools/linux-sandbox-pid1.cc:633: error: expected primary-expression at end of input
src/main/tools/linux-sandbox-pid1.cc:633: error: expected ')' at end of input
src/main/tools/linux-sandbox-pid1.cc:633: error: expected statement at end of input
src/main/tools/linux-sandbox-pid1.cc:633: error: expected '}' at end of input
src/main/tools/linux-sandbox-pid1.cc: At global scope:
src/main/tools/linux-sandbox-pid1.cc:57: warning: 'global_child_pid' defined but not used
src/main/tools/linux-sandbox-pid1.cc:61: warning: 'void SetupSelfDestruction(int
)' defined but not used
src/main/tools/linux-sandbox-pid1.cc:84: warning: 'void SetupMountNamespace()' defined but not used
src/main/tools/linux-sandbox-pid1.cc:112: warning: 'void SetupUserNamespace()' defined but not used
src/main/tools/linux-sandbox-pid1.cc:140: warning: 'void SetupUtsNamespace()' defined but not used
src/main/tools/linux-sandbox-pid1.cc:150: warning: 'void SetupHelperFiles()' defined but not used
src/main/tools/linux-sandbox-pid1.cc:170: warning: 'bool IsDirectory(const char_)' defined but not used
src/main/tools/linux-sandbox-pid1.cc:231: warning: 'void MountFilesystems()' defined but not used
cc1plus: warning: unrecognized command line option "-Wno-free-nonheap-object"
Target //src:bazel failed to build
INFO: Elapsed time: 3.156s, Critical Path: 0.80s
cat /proc/version
Linux version 2.6.32-573.18.1.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Tue Feb 9 22:46:17 UTC 2016
gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@is03wlei is03wlei changed the title Bazel compilation error Bazel compilation error on commit bb5901b Sep 27, 2016
@damienmg damienmg added type: bug P1 I'll work on this now. (Assignee required) Release blocker labels Sep 28, 2016
@damienmg
Copy link
Contributor

@philwo Seems like the new sandbox has some compilation error with older gcc. Probably easy to fix. We can add integration test for that probably by testing the good centos on docker (see tools/cpp/test/Dockerfile.XXX)

/cc @katre

@philwo
Copy link
Member

philwo commented Sep 28, 2016

Thanks for the report and sorry that it didn't work for you! Would using a binary release of Bazel, or alternatively building Bazel on a system with a newer OS and then copying the resulting binary to your workstation work for you?

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16)
Copyright (C) 2010 Free Software Foundation, Inc.

That gcc doesn't support C++ 11 or more precisely, doesn't support range-based for, which we use in our code (see error message + answer in this StackOverflow question for comparison: http://stackoverflow.com/questions/7071199/g-doesnt-compile-c0x-range-based-for-loop).

@damienmg I think this is not a sandbox issue and not a regression either, because we use C++11 in the launcher, too, since Bazel exists: https://github.com/bazelbuild/bazel/blame/master/src/main/cpp/blaze.cc#L454 ("blame" points to some commit from February 25th 2015 where that line was added).

I don't think you could ever bootstrap Bazel on CentOS 6.x with the default gcc? Did this work before?

@philwo philwo closed this as completed Sep 28, 2016
@damienmg
Copy link
Contributor

Oh indeed, sorry for the noise. People building on CentOS generally install a newer gcc. See https://github.com/bazelbuild/bazel/blob/master/tools/cpp/test/Dockerfile.centos6.7#L11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 I'll work on this now. (Assignee required) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants