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

Bazel build fails on ppc64le error: jni_md.h: No such file or directory #11754

Closed
rashmi-ibm opened this issue Jul 13, 2020 · 6 comments
Closed

Comments

@rashmi-ibm
Copy link

rashmi-ibm commented Jul 13, 2020

Description of the problem / feature request:

Bazel build fails on ppc64le error: jni_md.h

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

  wget https://github.com/bazelbuild/bazel/releases/download/3.3.0/bazel-3.3.0-dist.zip
  unzip bazel-3.3.0-dist.zip

  EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh

What operating system are you running Bazel on?

Rhel 7.6 on ppc64le, Rhel 8 on ppc64le

Have you found anything relevant by searching the web?

#10746

Any other information, logs, or outputs that you want to share?

ERROR: /root/rashmi/bazel/src/main/java/com/google/devtools/build/lib/syntax/BUILD:150:1: C++ compilation of rule '//src/main/java/com/google/devtools/build/lib/syntax:libcpu_profiler.so' failed (Exit 1): gcc failed: error executing command
(cd /tmp/bazel_M38Hj455/out/execroot/io_bazel &&
exec env -
PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.ppc64le/include/linux/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/root/go/bin:/root/rashmi/boringssl/build
PWD=/proc/self/cwd
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/ppc-opt/bin/src/main/java/com/google/devtools/build/lib/syntax/objs/libcpu_profiler.so/cpu_profiler_unimpl.pic.d '-frandom-seed=bazel-out/ppc-opt/bin/src/main/java/com/google/devtools/build/lib/syntax/objs/libcpu_profiler.so/cpu_profiler_unimpl.pic.o' -fPIC -iquote . -iquote bazel-out/ppc-opt/bin -iquote external/bazel_tools -iquote bazel-out/ppc-opt/bin/external/bazel_tools -isystem external/bazel_tools/tools/jdk/include -isystem bazel-out/ppc-opt/bin/external/bazel_tools/tools/jdk/include -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c src/main/java/com/google/devtools/build/lib/syntax/cpu_profiler_unimpl.cc -o bazel-out/ppc-opt/bin/src/main/java/com/google/devtools/build/lib/syntax/_objs/libcpu_profiler.so/cpu_profiler_unimpl.pic.o)
Execution platform: //:default_host_platform
In file included from src/main/java/com/google/devtools/build/lib/syntax/cpu_profiler_unimpl.cc:17:0:
bazel-out/ppc-opt/bin/external/bazel_tools/tools/jdk/include/jni.h:45:10: fatal error: jni_md.h: No such file or directory
#include "jni_md.h"
^~~~~~~~~~
compilation terminated.
Target //src:bazel_nojdk failed to build
INFO: Elapsed time: 41.118s, Critical Path: 12.09s
INFO: 262 processes: 262 local.
FAILED: Build did NOT complete successfully

ERROR: Could not build Bazel

@rashmi-ibm
Copy link
Author

Build steps with version 2.0.0 builds successfully:-
yum update -y
yum install -y java-1.8.0-openjdk-devel autoconf libtool curl gcc-c++ python3 wget unzip git zip

BAZEL_VERSION 2.0.0
 mkdir /bazel &&     cd /bazel   
curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-dist.zip
unzip bazel-$BAZEL_VERSION-dist.zip
sed -i '/--action_env=PATH \\/a\  --host_javabase=@bazel_tools//tools/jdk:jdk \\' compile.sh
ln -sf /usr/bin/python3 /usr/bin/python
python --version
bash ./compile.sh

Versio 2.2.0 and above fails with the error : jni_md.h: No such file or directory::

mkdir test
 cd test/
 BAZEL_VERSION=2.2.0
 mkdir bazel && cd bazel 
 curl -fSsL -O https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/bazel-$BAZEL_VERSION-dist.zip
 unzip bazel-$BAZEL_VERSION-dist.zip
 sed -i '/--action_env=PATH \\/a\  --host_javabase=@bazel_tools//tools/jdk:jdk \\' compile.sh
 bash ./compile.sh

@koenvervloesem
Copy link

koenvervloesem commented Jul 13, 2020

It looks like this has been fixed in Bazel 3.4.0, released 4 hours ago.

@davido
Copy link
Contributor

davido commented Jul 14, 2020

Duplicate of #11643.

@meisterT
Copy link
Member

@rashmi-ibm can you confirm that this is fixed with Bazel 3.4.1

@rashmi-ibm
Copy link
Author

Bazel 3.4.0 works fine on Power.

@meisterT
Copy link
Member

Thanks for confirming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants