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
Default to Java17-based builder-images for native executable generation #26319
Default to Java17-based builder-images for native executable generation #26319
Conversation
Question is are there JDK version specific hooks being done in Quarkus and relevant extensions at the Java/Bytecode level based on the JVM version in use. If so, would that effect say, |
@jerboaa it's a good question but no I'm not aware of us deciding to generate different code based on the configured target. Of course this is a bit dangerous still as JDK 11 and 17 are not the same - in particular it's also a bit stricter in some cases with module visibilities. But since in theory we're supporting JDK 17 already and aren't aware of specific problems, I'm +1 to make the switch not least to encourage becoming aware of any particular issue - and since JDK17 is the future, we need to fix any such issue anyway. |
...eployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildContainerRunner.java
Outdated
Show resolved
Hide resolved
…h Java 17" This reverts commit e2771de and makes the use of java17-based builder-images the default without taking into account the JVM version used to build the project. The motivation for this change is that the builder-image compiles bytecode to binary files and in theory a Java17-based builder-image should be able to compile Java bytecode generated by a Java11 compiler and produce a native executable that behaves the same as a native executable generated by a Java11-based builder-image. A key difference between a native executable generated by a Java11-based builder-image and a native executable generated by a Java17-based builder-image is that they include (embedded in the native executable) different implementations of the JDK standard libraries. In theory this should not be an issue, given that Java is backwards compatible and the Java11 APIs of the standard libraries should still be implemented and respected in Java17. This change will allow us to test this hypothesis in practice as well :) If things work as expected then we can drop Java11-based builder-images and only generate/maintain Java17-based ones.
f4906a9
to
7999502
Compare
Failing Jobs - Building 7999502
Full information is available in the Build summary check run. Failures⚙️ Gradle Tests - JDK 11 Windows #- Failing: integration-tests/gradle
📦 integration-tests/gradle✖
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup! Thanks :)
This reverts commit e2771de and makes
the use of java17-based builder-images the default without taking into
account the JVM version used to build the project.
The motivation for this change is that the builder-image compiles
bytecode to binary files and in theory a Java17-based builder-image
should be able to compile Java bytecode generated by a Java11 compiler
and produce a native executable that behaves the same as a native
executable generated by a Java11-based builder-image.
A key difference between a native executable generated by a Java11-based
builder-image and a native executable generated by a Java17-based
builder-image is that they include (embedded in the native executable)
different implementations of the JDK standard libraries. In theory this
should not be an issue, given that Java is backwards compatible and the
Java11 APIs of the standard libraries should still be implemented and
respected in Java17.
This change will allow us to test this hypothesis in practice as well :)
If things work as expected then we can drop Java11-based builder-images
and only generate/maintain Java17-based ones.