-
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
javac.jar
updated to JDK 10; will not run on JDK 8 as --host_javabase
anymore
#6035
Comments
I may add that VanillaJavaBuilder on JDK8 does trigger at least one javac bug (the one with the imports) and that some users have already reported that to us. So falling back to VanillaJavaBuilder is not only a loss of functionality but also a breaking change for some. |
To clarify the situation, I have some questions. This is a breaking change, right? Do we have any idea how many many users this will break? Will the users get a meaningful error message? |
I think this is only theoretical problem. I'm not aware of anyone who is passing
IIUC, the fact that Bazel is using embedded JDK10 (or even switch to using JDK11 as embedded JDK in near future), doesn't matter to us, as long as Bazel@HEAD still producing Java 8 byte code per default. The only huge breaking change for us (all Bazel users?) would be bumping the default toolchain to post Java 8 versions, e.g. with this diff applied on Bazel@HEAD:
Bazel would produce (without passing any options) Java 10 byte code per default:
IMO such a Bazel change should be properly announced so that Bazel users can adjust their build toolchains, IDE integrations and CIs to still produce Java 8 byte code if required (on stable branches Java 8 compatibility should be maintained for years, and, obviously, we would still like to only have one Bazel version installed on our CI-Docker image and build all current and recent Gerrit versions with latest and greatest Bazel release). So that with the diff above (that switched Bazel default language level to Java 10), I still don't need to pass
My environment:
|
Yes, explicitly configuring
I haven't seen a lot of use-cases that aren't met by the default toolchain and where
Not particularly. The default toolchain includes JVM flags that don't exist on JDK 8, so compilation actions fail before JavaBuilder is even executed:
For the most part, yes: That configuration provides a working I tried to improve the RELNOTES entry from 3619e90. The draft release notes for 0.17 includes this: """
Yep, that's the goal.
Agreed, there are no plans to do that, or at least not for a long time. If/when it happens I'd expect it to be announced well in advance, and for it to be easy to keep using the Java 8 language level by passing some additional configuration. |
Is this from 0.16.x? I think this is blocking our upgrade. We’re on 0.15.2
and are seeing an error with “-Xbootclasspath/p is no longer a supported
option”.
I might be wrong since I haven’t had to dive to the error or this issue.
I’ll try the workaround and update.
…On Sun, 2 Sep 2018 at 0:37 Liam Miller-Cushon ***@***.***> wrote:
This is a breaking change, right?
Yes, explicitly configuring host_javabase=<jdk8> but using the default
java_toolchain no longer works.
Do we have any idea how many many users this will break?
I haven't seen a lot of use-cases that aren't met by the default toolchain
and where host_javabase=<jdk8> is a hard requirement. But in general I
don't think we have good data on the usage of particular Java toolchain
features, so it's hard to say.
Will the users get a meaningful error message?
Not particularly. The default toolchain includes JVM flags that don't
exist on JDK 8, so compilation actions fail before JavaBuilder is even
executed:
bazel build --host_javabase=:jdk8 :all
...
---8<---8<--- Start of log, file at /usr/local/google/home/cushon/.cache/bazel/_bazel_cushon/8c38d57ae237ae214c53581f830f9e07/bazel-workers/worker-6-Javac.log ---8<---8<---
Unrecognized VM option 'CompactStrings'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
---8<---8<--- End of log ---8<---8<---
If a project is broken by the change, all they have to do is pass extra
flags?
For the most part, yes: ***@***.***_tools//tools/jdk:to
olchain_hostjdk8 ***@***.***_tools//tools/jdk:toolchain_hostjdk8
.
That configuration provides a working host_javabase=<jdk8> compatible
toolchain, but it isn't always a drop-in replacement for the default
toolchain as @buchgr <https://github.com/buchgr> noted.
I tried to improve the RELNOTES entry from 3619e90
<3619e90>.
The draft release notes for 0.17
<https://docs.google.com/document/d/1wDvulLlj4NAlPZamdlEVFORks3YXJonCjyuQMUQEmB0/edit?usp=sharing>
includes this:
"""
The default java_toolchain no longer supports using JDK 8 as a
--host_javabase. To use JDK 8 as a --host_javabase, also set ***@***.***_tools//tools/jdk:to
olchain_hostjdk8 ***@***.***_tools//tools/jdk:toolchain_hostjdk8.
Note that toolchain_java8 uses VanillaJavaBuilder (which does not support
Error Prone, Strict Java Deps, or reduced classpaths) and disables header
compilation.
"""
IIUC, the fact that Bazel is using embedded JDK10 (or even switch to using
JDK11 as embedded JDK in near future), doesn't matter to us, as long as
***@***.*** still producing Java 8 byte code per default.
Yep, that's the goal.
The only huge breaking change for us (all Bazel users?) would be bumping
the default toolchain to post Java 8 versions
Agreed, there are no plans to do that, or at least not for a long time.
If/when it happens I'd expect it to be announced well in advance, and for
it to be easy to keep using the Java 8 language level by passing some
additional configuration.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6035 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF6g426f6m8LMSugJ1lJ_-N9UuMe5ks5uWv4qgaJpZM4WThHI>
.
|
@ittaiz the issue described in the original comment affects 0.17rc1. Can you report the problem you're experiencing separately and include a way to reproduce it? |
""" I find the improved release notes version still misleading, especially the "Note that toolchain_java8 uses VanillaJavaBuilder (which does not support Error Prone, Strict Java Deps, or reduced classpaths) and disables header compilation." - part, because on most recent Bazel@HEAD (c8e6796) passing
|
Thanks, that was a typo: I meant |
Indeed, that would be much more clearer. |
Fixes #6035. This change rolls back the version of the JDK embedded into Bazel to 9. *** Reason for rollback *** Bazel 0.17 still needs to support JDK 8 and we need to roll out nits deprecation behind a flag of some sort. *** Original change description *** Clean up Java toolchain configuration now that JDK 8 host_javabases are no longer supported. PiperOrigin-RevId: 211953405
Fixes #6035. This change rolls back the version of the JDK embedded into Bazel to 9. *** Reason for rollback *** Bazel 0.17 still needs to support JDK 8 and we need to roll out nits deprecation behind a flag of some sort. *** Original change description *** Clean up Java toolchain configuration now that JDK 8 host_javabases are no longer supported. PiperOrigin-RevId: 211953405
Fixes #6035. This change rolls back the version of the JDK embedded into Bazel to 9. *** Reason for rollback *** Bazel 0.17 still needs to support JDK 8 and we need to roll out nits deprecation behind a flag of some sort. *** Original change description *** Clean up Java toolchain configuration now that JDK 8 host_javabases are no longer supported. PiperOrigin-RevId: 211953405
Fixes #6035. This change rolls back the version of the JDK embedded into Bazel to 9. *** Reason for rollback *** Bazel 0.17 still needs to support JDK 8 and we need to roll out nits deprecation behind a flag of some sort. *** Original change description *** Clean up Java toolchain configuration now that JDK 8 host_javabases are no longer supported. PiperOrigin-RevId: 211953405
Fixes #6035. This change rolls back the version of the JDK embedded into Bazel to 9. *** Reason for rollback *** Bazel 0.17 still needs to support JDK 8 and we need to roll out nits deprecation behind a flag of some sort. *** Original change description *** Clean up Java toolchain configuration now that JDK 8 host_javabases are no longer supported. PiperOrigin-RevId: 211953405
Fixes #6035. This change rolls back the version of the JDK embedded into Bazel to 9. *** Reason for rollback *** Bazel 0.17 still needs to support JDK 8 and we need to roll out nits deprecation behind a flag of some sort. *** Original change description *** Clean up Java toolchain configuration now that JDK 8 host_javabases are no longer supported. PiperOrigin-RevId: 211953405
Since @cushon updated the
javac
embedded into Bazel to the version in JDK 10,--host_javabase=<JDK8>
won't work anymore.Mitigating circumstances are that if we don't find a JDK, we still default to the embedded one, which does work with the embedded
javac
and that it's possible to revert to VanillaJavaBuilder to make Bazel work with--host_javabase=<JDK8>
at the cost of some loss of functionality.Before we release, we should try to ensure that we don't have to have another postmortem other than the one in the making for 0.16 .
The text was updated successfully, but these errors were encountered: