bazel failed to build tensorflow serving

Created on 4 Apr 2019  路  8Comments  路  Source: bazelbuild/bazel

ATTENTION! Please read and follow:

Description of the problem / feature request:

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]#

Feature requests: what underlying problem are you trying to solve with this feature?

Unable to build tensorflow serving using bazel

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

  1. Install bazel 0.24
  2. Get git clone using git clone https://github.com/tensorflow/serving.git
  3. cd serving
  4. Run bazel build tensorflow_serving/...

What operating system are you running Bazel on?

RHEL 8.0 PPC64 LE

What's the output of bazel info release?

[root@brazossrik01 serving]# bazel info release
release 0.24.0- (@non-git)
[root@brazossrik01 serving]#

If bazel info release returns "development version" or "(@non-git)", tell us how you built Bazel.

Replace this line with your answer.

What's the output of 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]#

Have you found anything relevant by searching the web?

Nothing useful found.

Replace these lines with your answer.

Places to look:

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

[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]#

P4 team-Rules-Java

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.

All 8 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kastiglione picture kastiglione  路  3Comments

ajaysaini-sgvu picture ajaysaini-sgvu  路  3Comments

mdzoba picture mdzoba  路  3Comments

cyberbono3 picture cyberbono3  路  3Comments

davidzchen picture davidzchen  路  3Comments