-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
DumpPlatformClassPath.dumpJDK9AndNewerBootClassPath does not work with openjdk16 on OSX #13138
Comments
We haven't looked yet into JDK16 support, but apparently the internals Bazel is using have changed. Thanks for the report! I'd be glad to see some more investigation if the modules just need to be exported and we will accept PRs that will provide early support for JDK16. |
That's the result of JEP 396: Strongly Encapsulate JDK Internals by Default That specific failure can be worked around with the JVM flag We'll likely need to start passing similar flags to other tools that use internal javac APIs (including JavaBuilder). FWIW |
Oh, I see. I was confused by |
|
The way to use an unsupported JDK has changed. Adding Also adding an extra |
Thanks for clarifying. I will try to put together a change to add support for JDK 16 using There is another issue with exporting of diff --git a/tools/jdk/default_java_toolchain.bzl b/tools/jdk/default_java_toolchain.bzl
index 03c0760ff3..dca07e0139 100644
--- a/tools/jdk/default_java_toolchain.bzl
+++ b/tools/jdk/default_java_toolchain.bzl
@@ -233,6 +233,8 @@ def _bootclasspath_impl(ctx):
args = ctx.actions.args()
args.add("-XX:+IgnoreUnrecognizedVMOptions")
args.add("--add-exports=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED")
+ args.add("--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED")
+ args.add("--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED")
args.add_joined(
"-cp",
[class_outputs[0].dirname, "%s/lib/tools.jar" % host_javabase.java_home], |
Closes bazelbuild#13138. See: [1] for more details. [1] https://openjdk.java.net/jeps/396 Change-Id: I9270602cd9157545a2f95b271592bd953f17264f
Closes bazelbuild#13138. See: [1] for more details. [1] https://openjdk.java.net/jeps/396 Change-Id: I9270602cd9157545a2f95b271592bd953f17264f
Closes bazelbuild#13138. See: [1] for more details. [1] https://openjdk.java.net/jeps/396 Change-Id: I9270602cd9157545a2f95b271592bd953f17264f
Closes bazelbuild#13138. See: [1] for more details. [1] https://openjdk.java.net/jeps/396 Change-Id: I9270602cd9157545a2f95b271592bd953f17264f
Closes bazelbuild#13138. See: [1] for more details. [1] https://openjdk.java.net/jeps/396 Change-Id: I9270602cd9157545a2f95b271592bd953f17264f
Fixes #13138 PiperOrigin-RevId: 366835946
Description of the problem / feature request:
bazel build
fails with host openjdk16Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
.bazelrc
:command:
bazel build --sandbox_debug ...:all
result:
What operating system are you running Bazel on?
macOS Big Sur 11.2.2
What's the output of
bazel info release
?release 4.0.0-homebrew
Have you found anything relevant by searching the web?
Likely, it works on other OS: https://stackoverflow.com/a/65161064
Any other information, logs, or outputs that you want to share?
OpenJDK16 taken from here: https://jdk.java.net/16/
(https://download.java.net/java/GA/jdk16/7863447f0ab643c585b9bdebf67c69db/36/GPL/openjdk-16_osx-x64_bin.tar.gz)
The text was updated successfully, but these errors were encountered: