Bazel: Bazel as of 10/7/2016 does not build on RHEL 6.8

Created on 7 Oct 2016  ยท  10Comments  ยท  Source: bazelbuild/bazel

git clone https://github.com/bazelbuild/bazel.git
cd bazel
./compile.sh
...
ERROR: /root/bazel/third_party/ijar/BUILD:33:1: C++ compilation of rule '//third_party/ijar:zlib_client' failed: process-wrapper failed: error executing command
  (cd /tmp/bazel_P18dy8xh/out/bazel-sandbox/e3185036-67f8-47b0-813f-63bbdf7961b6-20/execroot/bazel && \
  exec env - \
    PATH=/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/bin:/bin:/sbin:/usr/sbin:/usr/rcf-krb5/bin:/usr/rcf/bin:/afs/rcf/admin/bin:/root/bin \
  /tmp/bazel_P18dy8xh/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 -g0 '-std=c++0x' -MD -MF bazel-out/host/bin/third_party/ijar/_objs/zlib_client/third_party/ijar/zlib_client.d '-frandom-seed=bazel-out/host/bin/third_party/ijar/_objs/zlib_client/third_party/ijar/zlib_client.o' -iquote . -iquote bazel-out/host/genfiles -iquote external/bazel_tools -iquote bazel-out/host/genfiles/external/bazel_tools -isystem third_party/zlib -isystem bazel-out/host/genfiles/third_party/zlib -isystem external/bazel_tools/tools/cpp/gcc3 -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c third_party/ijar/zlib_client.cc -o bazel-out/host/bin/third_party/ijar/_objs/zlib_client/third_party/ijar/zlib_client.o).
In file included from third_party/ijar/zlib_client.cc:20:
./third_party/ijar/zlib_client.h:64: error: 'numeric_limits' is not a member of 'std'
./third_party/ijar/zlib_client.h:64: error: expected primary-expression before '>' token
./third_party/ijar/zlib_client.h:64: error: '::max' has not been declared
./third_party/ijar/zlib_client.h:64: error: a function call cannot appear in a constant-expression
cc1plus: warning: unrecognized command line option "-Wno-free-nonheap-object"
Target //src:bazel failed to build
INFO: Elapsed time: 43.958s, Critical Path: 15.40s

ERROR: Could not build Bazel
under investigation

Most helpful comment

Trying again now with devtoolset-2-binutils installed.

All 10 comments

What is your version of gcc?

Hi Damien,

The latest available to RHEL 6.x: gcc-4.4.7-17.el6.x86_64

I guess this is too old, you could try to install an earlier version of gcc through the devtools 2 (http://people.centos.org/tru/devtools-2/devtools-2.repo)

GCC 4.8.2 from devtools-2 fails as well, in a different way:

bazel:rcf-test-rh6-64# gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 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.

bazel:rcf-test-rh6-64# ./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_mjw04a7e/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_mjw04a7e/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: /root/bazel/src/main/tools/BUILD:3:1: undeclared inclusion(s) in rule '//src/main/tools:process-wrapper':
this rule is missing dependency declarations for the following files included by 'src/main/tools/process-wrapper.c':
  '/usr/include/err.h'
  '/usr/include/features.h'
  '/usr/include/sys/cdefs.h'
  '/usr/include/bits/wordsize.h'
  '/usr/include/gnu/stubs.h'
  '/usr/include/gnu/stubs-64.h'
  '/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stdarg.h'
  '/usr/include/errno.h'
  '/usr/include/bits/errno.h'
  '/usr/include/linux/errno.h'
  '/usr/include/asm/errno.h'
  '/usr/include/asm-generic/errno.h'
  '/usr/include/asm-generic/errno-base.h'
  '/usr/include/signal.h'
  '/usr/include/bits/sigset.h'
  '/usr/include/bits/types.h'
  '/usr/include/bits/typesizes.h'
  '/usr/include/bits/signum.h'
  '/usr/include/time.h'
  '/usr/include/bits/siginfo.h'
  '/usr/include/bits/sigaction.h'
  '/usr/include/bits/sigcontext.h'
  '/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stddef.h'
  '/usr/include/bits/sigstack.h'
  '/usr/include/sys/ucontext.h'
  '/usr/include/bits/pthreadtypes.h'
  '/usr/include/bits/sigthread.h'
  '/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stdbool.h'
  '/usr/include/stdio.h'
  '/usr/include/libio.h'
  '/usr/include/_G_config.h'
  '/usr/include/wchar.h'
  '/usr/include/bits/stdio_lim.h'
  '/usr/include/bits/sys_errlist.h'
  '/usr/include/bits/stdio.h'
  '/usr/include/bits/stdio2.h'
  '/usr/include/stdlib.h'
  '/usr/include/bits/waitflags.h'
  '/usr/include/bits/waitstatus.h'
  '/usr/include/endian.h'
  '/usr/include/bits/endian.h'
  '/usr/include/bits/byteswap.h'
  '/usr/include/xlocale.h'
  '/usr/include/sys/types.h'
  '/usr/include/sys/select.h'
  '/usr/include/bits/select.h'
  '/usr/include/bits/time.h'
  '/usr/include/sys/sysmacros.h'
  '/usr/include/alloca.h'
  '/usr/include/bits/stdlib.h'
  '/usr/include/string.h'
  '/usr/include/bits/string.h'
  '/usr/include/bits/string2.h'
  '/usr/include/bits/string3.h'
  '/usr/include/sys/stat.h'
  '/usr/include/bits/stat.h'
  '/usr/include/sys/wait.h'
  '/usr/include/sys/resource.h'
  '/usr/include/bits/resource.h'
  '/usr/include/unistd.h'
  '/usr/include/bits/posix_opt.h'
  '/usr/include/bits/environments.h'
  '/usr/include/bits/confname.h'
  '/usr/include/getopt.h'
  '/usr/include/bits/unistd.h'.
Target //src:bazel failed to build
INFO: Elapsed time: 39.341s, Critical Path: 5.95s

ERROR: Could not build Bazel

Can you try after doing export CC=$(which gcc)?

On Wed, Oct 12, 2016 at 4:46 PM Jeff Blaine [email protected]
wrote:

GCC 4.8.2 from devtools-2 fails as well, in a different way:

bazel:rcf-test-rh6-64# gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 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.

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_mjw04a7e/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_mjw04a7e/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: /root/bazel/src/main/tools/BUILD:3:1: undeclared inclusion(s) in rule '//src/main/tools:process-wrapper':
this rule is missing dependency declarations for the following files included by 'src/main/tools/process-wrapper.c':
'/usr/include/err.h'
'/usr/include/features.h'
'/usr/include/sys/cdefs.h'
'/usr/include/bits/wordsize.h'
'/usr/include/gnu/stubs.h'
'/usr/include/gnu/stubs-64.h'
'/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stdarg.h'
'/usr/include/errno.h'
'/usr/include/bits/errno.h'
'/usr/include/linux/errno.h'
'/usr/include/asm/errno.h'
'/usr/include/asm-generic/errno.h'
'/usr/include/asm-generic/errno-base.h'
'/usr/include/signal.h'
'/usr/include/bits/sigset.h'
'/usr/include/bits/types.h'
'/usr/include/bits/typesizes.h'
'/usr/include/bits/signum.h'
'/usr/include/time.h'
'/usr/include/bits/siginfo.h'
'/usr/include/bits/sigaction.h'
'/usr/include/bits/sigcontext.h'
'/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stddef.h'
'/usr/include/bits/sigstack.h'
'/usr/include/sys/ucontext.h'
'/usr/include/bits/pthreadtypes.h'
'/usr/include/bits/sigthread.h'
'/opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64-redhat-linux/4.8.2/include/stdbool.h'
'/usr/include/stdio.h'
'/usr/include/libio.h'
'/usr/include/_G_config.h'
'/usr/include/wchar.h'
'/usr/include/bits/stdio_lim.h'
'/usr/include/bits/sys_errlist.h'
'/usr/include/bits/stdio.h'
'/usr/include/bits/stdio2.h'
'/usr/include/stdlib.h'
'/usr/include/bits/waitflags.h'
'/usr/include/bits/waitstatus.h'
'/usr/include/endian.h'
'/usr/include/bits/endian.h'
'/usr/include/bits/byteswap.h'
'/usr/include/xlocale.h'
'/usr/include/sys/types.h'
'/usr/include/sys/select.h'
'/usr/include/bits/select.h'
'/usr/include/bits/time.h'
'/usr/include/sys/sysmacros.h'
'/usr/include/alloca.h'
'/usr/include/bits/stdlib.h'
'/usr/include/string.h'
'/usr/include/bits/string.h'
'/usr/include/bits/string2.h'
'/usr/include/bits/string3.h'
'/usr/include/sys/stat.h'
'/usr/include/bits/stat.h'
'/usr/include/sys/wait.h'
'/usr/include/sys/resource.h'
'/usr/include/bits/resource.h'
'/usr/include/unistd.h'
'/usr/include/bits/posix_opt.h'
'/usr/include/bits/environments.h'
'/usr/include/bits/confname.h'
'/usr/include/getopt.h'
'/usr/include/bits/unistd.h'.
Target //src:bazel failed to build
INFO: Elapsed time: 39.341s, Critical Path: 5.95s

ERROR: Could not build Bazel

โ€”
You are receiving this because you were assigned.

Reply to this email directly, view it on GitHub
https://github.com/bazelbuild/bazel/issues/1900#issuecomment-253232621,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADjHf6J5mXPQTl3yyw2wrKtcbCy-KUaHks5qzPG0gaJpZM4KRWtu
.

bazel:rcf-test-rh6-64# which g++
/opt/rh/devtoolset-2/root/usr/bin/g++
bazel:rcf-test-rh6-64# which gcc
/opt/rh/devtoolset-2/root/usr/bin/gcc
bazel:rcf-test-rh6-64# env | grep CC
CC=/opt/rh/devtoolset-2/root/usr/bin/gcc
bazel:rcf-test-rh6-64# ./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_JWD3uZGn/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_JWD3uZGn/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: /root/bazel/src/main/tools/BUILD:3:1: C++ compilation of rule '//src/main/tools:process-wrapper' failed: process-wrapper failed: error executing command
  (cd /tmp/bazel_JWD3uZGn/out/bazel-sandbox/0e0aecab-2f1e-4eb0-87b9-fba813a26774-0/execroot/bazel && \
  exec env - \
    LD_LIBRARY_PATH=/opt/rh/devtoolset-2/root/usr/lib64:/opt/rh/devtoolset-2/root/usr/lib \
    PATH=/opt/rh/devtoolset-2/root/usr/bin:/usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin:/bin:/sbin:/usr/sbin:/usr/rcf-krb5/bin:/usr/rcf/bin:/afs/rcf/admin/bin:/root/bin:/usr/bin:/bin:/sbin:/usr/sbin:/usr/rcf-krb5/bin:/usr/rcf/bin:/afs/rcf/admin/bin \
  /tmp/bazel_JWD3uZGn/out/execroot/bazel/_bin/process-wrapper -1 5 - - /opt/rh/devtoolset-2/root/usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -B/opt/rh/devtoolset-2/root/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-canonical-system-headers -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -MD -MF bazel-out/local-opt/bin/src/main/tools/_objs/process-wrapper/src/main/tools/process-tools.d -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 '-std=c99' -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/main/tools/process-tools.c -o bazel-out/local-opt/bin/src/main/tools/_objs/process-wrapper/src/main/tools/process-tools.o).
/tmp/ccF4VIlj.s: Assembler messages:
/tmp/ccF4VIlj.s:195: Error: expecting string instruction after `rep'
/tmp/ccF4VIlj.s:615: Error: expecting string instruction after `rep'
Target //src:bazel failed to build
INFO: Elapsed time: 35.054s, Critical Path: 5.63s

ERROR: Could not build Bazel

Trying again now with devtoolset-2-binutils installed.

That worked ... but generally speaking: "ugh"

...
INFO: Elapsed time: 1262.685s, Critical Path: 1210.31s
WARNING: /tmp/bazel_LI2ZpCQD/out/external/bazel_tools/WORKSPACE:1: Workspace name in /tmp/bazel_LI2ZpCQD/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.

Build successful! Binary is here: /root/bazel/output/bazel

Well working with non-standard gcc is always hard.

If CC is not set, bazel looks for the gcc on the path, which is usually the system default. Supporting old gcc is hard :(

@jblaine I followed your idea using devtoolset-gcc/g++ and build successfully. Before I used other verion gcc4.8.5 and build failt.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dslomov picture dslomov  ยท  71Comments

johnynek picture johnynek  ยท  105Comments

digitalsword picture digitalsword  ยท  110Comments

dfabulich picture dfabulich  ยท  67Comments

lacartelacarte picture lacartelacarte  ยท  87Comments