ATTENTION! Please read and follow:
- if this is a _question_ about how to build / test / query / deploy using Bazel, ask it on StackOverflow instead: https://stackoverflow.com/questions/tagged/bazel
- if this is a _discussion starter_, send it to [email protected]
- if this is a _bug_ or _feature request_, fill the form below as best as you can.
Failing to build tensorflow serving with below error:
[root@brazossrik01 serving]# bazel --server_javabase=$JAVA_HOME build tensorflow_serving/...
WARNING: Running Bazel server needs to be killed, because the startup options are different.
Starting local Bazel server and connecting to it...
ERROR: /root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
ERROR: Analysis of target '//tensorflow_serving/util:any_ptr_test' failed; build aborted:
/root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
INFO: Elapsed time: 9.330s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (58 packages loaded, 592 targets configured)
currently loading: @protobuf_archive// ... (4 packages)
Fetching @local_jdk; fetching
[root@brazossrik01 serving]#
I have JAVA_HOME set already.
[root@brazossrik01 serving]# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk
[root@brazossrik01 serving]#
bazel installation was successful with --host_javabase=@local_jdk//:jdk.
When building tensorflow serving, I am asked to put host_javabase , but bazel build doesn't have that argument itself.
[root@brazossrik01 serving]# env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bazel build tensorflow_serving/...
ERROR: /root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
ERROR: Analysis of target '//tensorflow_serving/core:aspired_version_policy_test' failed; build aborted:
/root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
INFO: Elapsed time: 2.204s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 6 targets configured)
currently loading: @org_tensorflow//tensorflow/core ... (5 packages)
[root@brazossrik01 serving]#
Unable to build tensorflow serving using bazel
RHEL 8.0 PPC64 LE
bazel info release?[root@brazossrik01 serving]# bazel info release
release 0.24.0- (@non-git)
[root@brazossrik01 serving]#
bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.Replace this line with your answer.
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?[root@brazossrik01 serving]# git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
https://github.com/tensorflow/serving.git
dd2f22b59632b08e2d5341eeed902b72ab50a4b1
dd2f22b59632b08e2d5341eeed902b72ab50a4b1
[root@brazossrik01 serving]#
Nothing useful found.
Replace these lines with your answer.
Places to look:
- StackOverflow: http://stackoverflow.com/questions/tagged/bazel
- GitHub issues: https://github.com/bazelbuild/bazel/issues
- email threads on https://groups.google.com/forum/#!forum/bazel-discuss
[root@brazossrik01 serving]# env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bazel build tensorflow_serving/...
ERROR: /root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
ERROR: Analysis of target '//tensorflow_serving/core:aspired_version_policy_test' failed; build aborted:
/root/.cache/bazel/_bazel_root/f4cd5ba853ee4ba782b3fe7dcccd62ad/external/bazel_tools/tools/jdk/BUILD:443:14: Configurable attribute "actual" doesn't match this configuration: Could not find a JDK for host execution environment, please explicitly provide one using --host_javabase.
INFO: Elapsed time: 2.204s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (4 packages loaded, 6 targets configured)
currently loading: @org_tensorflow//tensorflow/core ... (5 packages)
[root@brazossrik01 serving]#
Hi - Any updates I can get ? I am kind of blocked here as tensorflow serving build is getting failed. Please let me know if there is any workaround available. Thanks !
Try building with JDK 10.
I had a very similar error message: it seems that despite the docs (https://docs.bazel.build/versions/master/install-compile-source.html) -- which, as of today say only JDK 8 is supported -- JDK 8 is no longer well supported (see https://blog.bazel.build/2018/09/14/bazel-0.17.html for some hints about this, but I did not find those workarounds worked for later releases).
I'm sure Bazel is a great piece of software, but building Bazel, and working around it's many interwoven and often hard-coded or deeply embedded expectations, continues to be the hardest part of building Tensorflow.
Hi @srikanthjoshi, sorry for the late reply! Do you still have this problem?
Does bazel build tensorflow_serving/... --host_javabase=@local_jdk//:jdk work for you?
Hi - I tried with --host_javabase=@local_jdk//:jdk, it didn't work either. I got pre-built package. So, I am proceeding further with pre-built package. However, we might need to address this.
What error are you getting with bazel build tensorflow_serving/... --host_javabase=@local_jdk//:jdk?
I'm sure Bazel is a great piece of software, but building Bazel, and working around it's many interwoven and often hard-coded or deeply embedded expectations, continues to be the hardest part of building Tensorflow.
So true.
it seems that despite the docs (https://docs.bazel.build/versions/master/install-compile-source.html) -- which, as of today say only JDK 8 is supported -- JDK 8 is no longer well supported (see https://blog.bazel.build/2018/09/14/bazel-0.17.html for some hints about this, but I did not find those workarounds worked for later releases).
Very nice indeed. Having docs stating only JDK8 is supported but failing to work with JDK8 without jumping through hoops (if it works at all). I don't get why a build system would be build on top of Java which is proprietary and a real nightmare to install, especially on e.g. Power9
Most helpful comment
Try building with JDK 10.
I had a very similar error message: it seems that despite the docs (https://docs.bazel.build/versions/master/install-compile-source.html) -- which, as of today say only JDK 8 is supported -- JDK 8 is no longer well supported (see https://blog.bazel.build/2018/09/14/bazel-0.17.html for some hints about this, but I did not find those workarounds worked for later releases).
I'm sure Bazel is a great piece of software, but building Bazel, and working around it's many interwoven and often hard-coded or deeply embedded expectations, continues to be the hardest part of building Tensorflow.