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

Default to Java17-based builder-images for native executable generation #26319

Merged

Conversation

zakkak
Copy link
Contributor

@zakkak zakkak commented Jun 23, 2022

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.

@jerboaa
Copy link
Contributor

jerboaa commented Jun 23, 2022

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, -Dquarkus.package.type=native-sources builds? Could we binary compare a native-sources build with JDK 11 and JDK 17 and see if there are differences?

@Sanne
Copy link
Member

Sanne commented Jun 23, 2022

@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.

…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.
@zakkak zakkak force-pushed the default-to-java17-native-builder-images branch from f4906a9 to 7999502 Compare June 23, 2022 19:09
@zakkak zakkak requested a review from Sanne June 23, 2022 19:10
@zakkak zakkak added area/native-image env/graalvm-java17 Relating to using GraalVM native generation Java 11 release/noteworthy-feature labels Jun 23, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 23, 2022

Failing Jobs - Building 7999502

Status Name Step Failures Logs Raw logs
Gradle Tests - JDK 11 Windows Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Gradle Tests - JDK 11 Windows #

- Failing: integration-tests/gradle 

📦 integration-tests/gradle

io.quarkus.gradle.devmode.CompositeBuildWithDependenciesDevModeTest.main line 24 - More details - Source on GitHub

org.awaitility.core.ConditionTimeoutException: Condition with lambda expression in io.quarkus.test.devmode.util.DevModeTestUtils that uses java.util.function.Supplier, java.util.function.Supplierjava.util.concurrent.atomic.AtomicReference, java.util.concurrent.atomic.AtomicReferencejava.lang.String, java.lang.Stringboolean was not fulfilled within 1 minutes.
	at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
	at org.awaitility.core.CallableCondition.await(CallableCondition.java:78)

Copy link
Member

@Sanne Sanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup! Thanks :)

@Sanne Sanne merged commit bddfa06 into quarkusio:main Jun 28, 2022
@quarkus-bot quarkus-bot bot added this to the 2.11 - main milestone Jun 28, 2022
@zakkak zakkak deleted the default-to-java17-native-builder-images branch June 28, 2022 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants