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

Building Bazel from source on Power9 fails with "Could not find a JDK for host execution environment" #10377

Closed
Flamefire opened this issue Dec 6, 2019 · 5 comments
Labels
team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged

Comments

@Flamefire
Copy link
Contributor

Description of the problem / feature request:

I'd like to build bazel for Power9 (ppc64le) but it fails with a JDK related issue

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

Use a PPC system with openJDK 8 (javac 1.8.0-internal, or javac 1.8.0_222), download the source (*-dist.zip) and do ./compile.sh

What operating system are you running Bazel on?

RHEL 7.6

Have you found anything relevant by searching the web?

#10049
#7943
#8313
#6557
Pretty much this issue: https://stackoverflow.com/questions/56584783/bazel-buid-app-to-buildconfigurable-attribute-actual-doesnt-match-this-co

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

🍃  Building Bazel from scratch......
🍃  Building Bazel with Bazel.
.WARNING: --batch mode is deprecated. Please instead explicitly shut down your Bazel server using the command "bazel shutdown".
DEBUG: /tmp/bazel_gPZKDF3H/out/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:59:9: 
Current running Bazel is not a release version and one was not defined explicitly in rbe_autoconfig target. Falling back to '0.27.1'
DEBUG: /tmp/bazel_gPZKDF3H/out/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:103:9: rbe_ubuntu1804_java11 not using checked in configs as detect_java_home was set to True 
DEBUG: /tmp/bazel_gPZKDF3H/out/external/bazel_toolchains/rules/rbe_repo/version_check.bzl:59:9: 
Current running Bazel is not a release version and one was not defined explicitly in rbe_autoconfig target. Falling back to '0.27.1'
DEBUG: /tmp/bazel_gPZKDF3H/out/external/bazel_toolchains/rules/rbe_repo/checked_in.bzl:103:9: rbe_ubuntu1604_java8 not using checked in configs as detect_java_home was set to True 
DEBUG: /tmp/bazel_gPZKDF3H/out/external/build_bazel_rules_nodejs/internal/common/check_bazel_version.bzl:49:5: 
Current Bazel is not a release version, cannot check for compatibility.
DEBUG: /tmp/bazel_gPZKDF3H/out/external/build_bazel_rules_nodejs/internal/common/check_bazel_version.bzl:51:5: Make sure that you are running at least Bazel 0.17.1.
ERROR: /tmp/bazel_gPZKDF3H/out/external/bazel_tools/tools/jdk/BUILD:492: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: Call stack for the definition of repository 'remote_java_tools_linux' which is a http_archive (rule definition at /tmp/bazel_gPZKDF3H/out/external/bazel_tools/tools/build_defs/repo/http.bzl:262:16):
 - /DEFAULT.WORKSPACE.SUFFIX:240:1
ERROR: Analysis of target '//src:bazel_nojdk' failed; build aborted: 

/tmp/bazel_gPZKDF3H/out/external/bazel_tools/tools/jdk/BUILD:492: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: 7,462s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (113 packages loaded, 699 targets \
configured)
    currently loading: @bazel_tools//src/tools/launcher ... (2 packages)
    Fetching @local_jdk; Restarting.

ERROR: Could not build Bazel
@Flamefire
Copy link
Contributor Author

Apparently using EXTRA_BAZEL_ARGS='--host_javabase=@local_jdk//:jdk' ./compile.sh does work, but I don't fully understand the implications. If that is sane, couldn't this be used as a fallback/default?

@wdirons
Copy link

wdirons commented Dec 10, 2019

Apparently using EXTRA_BAZEL_ARGS='--host_javabase=@local_jdk//:jdk' ./compile.sh does work, but I don't fully understand the implications. If that is sane, couldn't this be used as a fallback/default?

Yes, that is how I build bazel on Power (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/ci_build/install/install_bazel_from_source.sh)

That just means it it using the JDK on the host machine and not the version embedded in Bazel.

For the latest Bazel versions I have been using openjdk 11.

@Flamefire
Copy link
Contributor Author

And what does it mean for the so installed Bazel? Will it continue using the system JDK? Will it bundle the system JDK?

However I can confirm that this at least works with openJDK 8 to build TensorFlow 2.0.0 on our Power system.

And finally:

If that is sane, couldn't this be used as a fallback/default? (In Bazel itself)

@wdirons
Copy link

wdirons commented Dec 10, 2019

Bazel built this way will use the system JDK.

@jin jin added team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged labels Dec 20, 2019
@philwo
Copy link
Member

philwo commented Feb 8, 2021

IIUC a solution / workaround was given in the discussion here. Please reopen if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website untriaged
Projects
None yet
Development

No branches or pull requests

4 participants