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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x86-64 binary installer does not work on RHEL-6 generation OSes #660

Closed
mj-harvey opened this issue Nov 30, 2015 · 24 comments
Closed

x86-64 binary installer does not work on RHEL-6 generation OSes #660

mj-harvey opened this issue Nov 30, 2015 · 24 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other type: bug
Milestone

Comments

@mj-harvey
Copy link

The perennial LIBC ABI incompatibility:

-bash-4.1$ ./bazel
./bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./bazel)
./bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./bazel)
./bazel: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./bazel)
-bash-4.1$ ldd ./bazel
./bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by ./bazel)
./bazel: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./bazel)
./bazel: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./bazel)
    linux-vdso.so.1 =>  (0x00007fffd4fff000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f3328181000)
    libz.so.1 => /lib64/libz.so.1 (0x00007f3327f6a000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007f3327c64000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f3327a4e000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f33276bd000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f33274a1000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003941600000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f332721d000)

@mj-harvey
Copy link
Author

@damienmg
Copy link
Contributor

This is a KI. We will expand the number of supported platform for binary release in the future but we cannot work on it right now.

@damienmg damienmg added type: bug P3 We're not considering working on this, but happy to review a PR. (No assignee) labels Nov 30, 2015
@mj-harvey
Copy link
Author

Fair enough, but the level of c++ used in the code seems to make it impossible to compile on a RHEL6 system that has only the standard, venerable, compiler packages installed (see other issue)

@damienmg
Copy link
Contributor

We should fix the C++ issue on the specific bugs. If we don't, then we will probably not be able to provide any binary release for those platform anyway :)

@kramasamy
Copy link

Even in CentOS it has the same issue. Hence we are not able to upgrade to bazel beta release. We are stuck with pre-beta version that we compiled and checked into the code base.

We are using bazel heavily to compile Heron, our new streaming system at Twitter.

@damienmg
Copy link
Contributor

damienmg commented Dec 1, 2015

You are not able to build from source neither?

@kramasamy
Copy link

@damienmg - I have not tried from building the source. If anybody has tried successfully, I am willing to give it a go!

@kramasamy
Copy link

Tried to compile from source for the release 0.1.1. My environment uses gcc/g++ 4.8.2 and Java 8.
I am getting the following errors:

gcc -o /tmp/bazel.DoG14492/namespace-sandbox -std=c99 src/main/tools/namespace-sandbox.c src/main/tools/process-tools.c -lm
In file included from src/main/tools/namespace-sandbox.c:35:0:
src/main/tools/namespace-sandbox.c: In function ‘CheckNamespacesSupported’:
src/main/tools/namespace-sandbox.c:92:26: error: ‘CLONE_NEWUSER’ undeclared (first use in this function)
CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWUTS |
^
src/main/tools/process-tools.h:34:8: note: in definition of macro ‘CHECK_CALL’
if ((x) == -1) {
^
src/main/tools/namespace-sandbox.c:92:26: note: each undeclared identifier is reported only once for each function it appears in
CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWUTS |
^
src/main/tools/process-tools.h:34:8: note: in definition of macro ‘CHECK_CALL’
if ((x) == -1) {
^
src/main/tools/namespace-sandbox.c:92:56: error: ‘CLONE_NEWUTS’ undeclared (first use in this function)
CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWUTS |
^
src/main/tools/process-tools.h:34:8: note: in definition of macro ‘CHECK_CALL’
if ((x) == -1) {
^
src/main/tools/namespace-sandbox.c:93:30: error: ‘CLONE_NEWIPC’ undeclared (first use in this function)
CLONE_NEWIPC | SIGCHLD,
^
src/main/tools/process-tools.h:34:8: note: in definition of macro ‘CHECK_CALL’
if ((x) == -1) {
^
src/main/tools/namespace-sandbox.c: In function ‘CreateNamespaces’:
src/main/tools/namespace-sandbox.c:266:17: error: ‘CLONE_NEWUSER’ undeclared (first use in this function)
if (unshare(CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC) ==
^
src/main/tools/namespace-sandbox.c:266:47: error: ‘CLONE_NEWUTS’ undeclared (first use in this function)
if (unshare(CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC) ==
^
src/main/tools/namespace-sandbox.c:266:62: error: ‘CLONE_NEWIPC’ undeclared (first use in this function)
if (unshare(CLONE_NEWUSER | CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC) ==
^
In file included from src/main/tools/namespace-sandbox.c:35:0:
src/main/tools/namespace-sandbox.c: In function ‘SetupDirectories’:
src/main/tools/namespace-sandbox.c:359:43: error: ‘MS_REC’ undeclared (first use in this function)
CHECK_CALL(mount("/proc", "proc", NULL, MS_REC | MS_BIND, NULL));
^
src/main/tools/process-tools.h:34:8: note: in definition of macro ‘CHECK_CALL’
if ((x) == -1) {
^
src/main/tools/namespace-sandbox.c: In function ‘ChangeRoot’:
src/main/tools/namespace-sandbox.c:468:32: error: ‘MNT_DETACH’ undeclared (first use in this function)
CHECK_CALL(umount2(old_root, MNT_DETACH));
^
src/main/tools/process-tools.h:34:8: note: in definition of macro ‘CHECK_CALL’
if ((x) == -1) {
^
src/main/tools/namespace-sandbox.c: In function ‘main’:
src/main/tools/namespace-sandbox.c:568:39: error: ‘MS_REC’ undeclared (first use in this function)
CHECK_CALL(mount("none", "/", NULL, MS_REC | MS_PRIVATE, NULL));
^
src/main/tools/process-tools.h:34:8: note: in definition of macro ‘CHECK_CALL’
if ((x) == -1) {
^
src/main/tools/namespace-sandbox.c:568:48: error: ‘MS_PRIVATE’ undeclared (first use in this function)
CHECK_CALL(mount("none", "/", NULL, MS_REC | MS_PRIVATE, NULL));
^
src/main/tools/process-tools.h:34:8: note: in definition of macro ‘CHECK_CALL’
if ((x) == -1) {
^

@damienmg
Copy link
Contributor

damienmg commented Dec 2, 2015

Arf we shouldn't build the namespace sandbox on system that does not support it.

Commenting the part https://github.com/bazelbuild/bazel/blob/master/scripts/bootstrap/compile.sh#L334 here for compiling the dummy one should workaround that.

@kramasamy
Copy link

I got further down and I am getting the following memory errors while compiling bazel

INFO: From Building src/main/java/libshell.jar (17 files):
Error occurred during initialization of VM
java.lang.OutOfMemoryError: unable to create new native thread
ERROR: /home/kramasamy/bazel-0.1.1/src/main/java/BUILD:3:1: Java compilation in rule '//src/main/java:shell' failed: java failed: error executing command external/local-jdk/bin/java -Xbootclasspath/p:third_party/java/jdk/langtools/javac.jar -client -jar bazel-out/host/bin/src/java_tools/buildjar/bootstrap_deploy.jar ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.

@damienmg
Copy link
Contributor

damienmg commented Dec 2, 2015

try to add build --jobs 100 or even lower in your bazelrc file (export BAZELRC=/path/to/bazelrc.file to use with compile.sh)

@kramasamy
Copy link

Thanks @damienmg for the suggestion. I was able to successfully compile it. After compilation, I would like to install it some where - similar to bazel-install for darwin and linux. Does it just involve only copying third_party/ tools/ to base_workspace directory and output/bazel to a bin directory? Or it has more steps?

@damienmg
Copy link
Contributor

damienmg commented Dec 7, 2015

you can build the installer by ./output/bazel build scripts/package:install.sh and then the installer will be at ./bazel-bin/scripts/package/install.sh

@kramasamy
Copy link

thanks @damienmg. when i try to build the installer, i get the following errors (even though I have set the bazelrc with build --jobs 100 as you recommended for compilation)

INFO: Found 1 target...
INFO: From Building src/main/protobuf/libworker_protocol_proto.jar (0 files) [for host]:
Error occurred during initialization of VM
java.lang.OutOfMemoryError: unable to create new native thread
ERROR: /home/kramasamy/bazel-0.1.2/src/main/protobuf/BUILD:20:2: Java compilation in rule '//src/main/protobuf:worker_protocol_proto' failed: java failed: error executing command external/local-jdk/bin/java -Xbootclasspath/p:external/bazel_tools/third_party/java/jdk/langtools/javac.jar -client -jar external/bazel_tools/tools/jdk/JavaBuilder_deploy.jar ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //scripts/packages:install.sh failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.772s, Critical Path: 0.28s.

@damienmg
Copy link
Contributor

damienmg commented Dec 7, 2015

oh sorry continue to use your bazelrc with:
./output/bazel --bazelrc=$BAZELRC build scripts/package:install.sh

@kramasamy
Copy link

looks like the issue remains -

/output/bazel --bazelrc=$BAZELRC build scripts/packages:install.sh
WARNING: Output base '/home/kramasamy/.cache/bazel/_bazel_kramasamy/eedb062397660dc3a3aaf174700b6f99' is on NFS. This may lead to surprising failures and undetermined behavior.
INFO: Found 1 target...
INFO: From Building src/main/protobuf/libtest_status_proto.jar (0 files):
Error occurred during initialization of VM
java.lang.OutOfMemoryError: unable to create new native thread
ERROR: /home/kramasamy/bazel-0.1.2/src/main/protobuf/BUILD:20:2: Java compilation in rule '//src/main/protobuf:test_status_proto' failed: java failed: error executing command external/local-jdk/bin/java -Xbootclasspath/p:external/bazel_tools/third_party/java/jdk/langtools/javac.jar -client -jar external/bazel_tools/tools/jdk/JavaBuilder_deploy.jar ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //scripts/packages:install.sh failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.214s, Critical Path: 1.07s.

@damienmg
Copy link
Contributor

damienmg commented Dec 7, 2015

./output/bazel build --jobs=10 scripts/package:install.sh ?

@kramasamy
Copy link

thanks @damienmg - that worked. let me try the installation now.

@kramasamy
Copy link

The entire compilation worked very well in centos 6 but with centos 5 I got the following errors

Compiling JNI libraries...
g++ -I . -I /usr/lib/jvm/java-1.8.0-twitter/include/ -I /usr/lib/jvm/java-1.8.0-twitter/include/linux -std=c++0x -fPIC -c -D_JNI_IMPLEMENTATION_ -DBLAZE_JAVA_CPU="k8" -DBLAZE_OPENSOURCE=1 -o /tmp/bazel.CBT15064/native/unix_jni.cc.o src/main/native/unix_jni.cc
src/main/native/unix_jni.cc: In function ‘void Java_com_google_devtools_build_lib_unix_FilesystemUtils_utime(JNIEnv*, jclass, jstring, jboolean, jint)’:
src/main/native/unix_jni.cc:471:34: error: ‘UTIME_OMIT’ was not declared in this scope
struct timespec spec[2] = {{0, UTIME_OMIT}, {modtime, now ? UTIME_NOW : 0}};
^
src/main/native/unix_jni.cc:471:63: error: ‘UTIME_NOW’ was not declared in this scope
struct timespec spec[2] = {{0, UTIME_OMIT}, {modtime, now ? UTIME_NOW : 0}};
^
src/main/native/unix_jni.cc:472:7: error: ‘::utimensat’ has not been declared
if (::utimensat(AT_FDCWD, path_chars, spec, 0) == -1) {

@damienmg
Copy link
Contributor

damienmg commented Dec 7, 2015

I guess it is missing some include with older compiler, what is the version of gcc?

@kramasamy
Copy link

Taking a closer look at the file unix_jni.cc, it uses some unix utilities that are available in centos 6, however there is a default implementation for it but the #ifdef __linux is too generic I believe - assumes a lot about the underlying OS.

@vitamin
Copy link

vitamin commented Apr 12, 2016

i have the same problem.
my system is Linux 2.6.32.43-tlinux-1.0.14-default #1 SMP Wed Jul 29 18:34:45 CST 2015 x86_64 x86_64 x86_64 GNU/Linux

bazel
/usr/local/bin/bazel: /usr/lib64/libstdc++.so.6: version GLIBCXX_3.4.14' not found (required by /usr/local/bin/bazel) /usr/local/bin/bazel: /usr/lib64/libstdc++.so.6: versionGLIBCXX_3.4.15' not found (required by /usr/local/bin/bazel)
/usr/local/bin/bazel: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /usr/local/bin/bazel)

@damienmg damienmg modified the milestone: 1.0 Jun 14, 2016
@zjh-nudger
Copy link

@kramasamy . I encounter the same problem(The utime utilities , such as 'UTIME_NOW' etc, are not found) on redhat5. Do you have some suggest for this problem. Thank you.

@hlopko
Copy link
Member

hlopko commented Mar 21, 2018

Closing since long obsolete, please file new issue if you discover problems

@hlopko hlopko closed this as completed Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other type: bug
Projects
None yet
Development

No branches or pull requests

7 participants