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

Cannot build Gerrit with JDK9 #5896

Closed
davido opened this issue Aug 15, 2018 · 2 comments
Closed

Cannot build Gerrit with JDK9 #5896

davido opened this issue Aug 15, 2018 · 2 comments

Comments

@davido
Copy link
Contributor

davido commented Aug 15, 2018

On most recent Bazel master (7574d84) the most recent Gerrit master (b0e82956b1e8b4b04d187c26ec6e055beeaedb82) cannot be built any more (it worked already) with JDK9:

$ java --version
openjdk 9.0.4
OpenJDK Runtime Environment (build 9.0.4+12-suse-4.2-x8664)
OpenJDK 64-Bit Server VM (build 9.0.4+12-suse-4.2-x8664, mixed mode)
$ b9 build --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java9 --java_toolchain=@bazel_tools//tools/jdk:toolchain_java9 :release
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_skylib/lib/versions.bzl:98:7: 
Current Bazel is not a release version, cannot check for compatibility.
DEBUG: /home/davido/.cache/bazel/_bazel_davido/27a001f4182820ef315d8d2d4f1edafe/external/bazel_skylib/lib/versions.bzl:99:7: Make sure that you are running at least Bazel 0.14.0.
INFO: Analysed target //:release (0 packages loaded).
INFO: Found 1 target...
ERROR: /home/davido/projects/gerrit/java/com/google/gerrit/launcher/BUILD:3:1: Building java/com/google/gerrit/launcher/liblauncher-class.jar (1 source file) failed (Exit 1)
Fatal Error: Unable to find package java.lang in classpath or bootclasspath
Target //:release failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.064s, Critical Path: 0.16s
INFO: 5 processes: 4 remote cache hit, 1 linux-sandbox.
FAILED: Build did NOT complete successfully
@davido
Copy link
Contributor Author

davido commented Aug 15, 2018

It worth noting, that upcoming Bazel 0.16.1 release (tested with rc2 from https://releases.bazel.build/0.16.1/rc2/index.html) doesn't seem to be affected: [1]. Only Bazel 0.17.0rc1 and master are affected.

[1] http://paste.openstack.org/show/728089

@cushon
Copy link
Contributor

cushon commented Aug 15, 2018

cc @buchgr

The regression was from updating the embedded JDK to 10 in 4c9149d. The javac we use doesn't support --release when running on JDK 10 yet.

Setting --server_javabase= to JDK 9 works around the problem.

The fix is to update to the JDK 10 javac, but we can't do that until we're ready to drop support for JDK 8 --host_javabases in the default toolchain.

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

2 participants