-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Enable ThrowMissingRegistrationErrors with GraalVM >= 23.1 #36378
base: main
Are you sure you want to change the base?
Enable ThrowMissingRegistrationErrors with GraalVM >= 23.1 #36378
Conversation
This comment has been minimized.
This comment has been minimized.
@zakkak Is there a test run of quarkus native tests with a graalvm for JDK 22 build with this somewhere (in order to gauge the impact of this change)? |
CI run with latest GraalVM for JDK 22-EA: https://github.com/graalvm/mandrel/actions/runs/6533188443 |
nativeImageArgs.add("--strict-image-heap"); | ||
// This feature will become available as non-experimental in the next release (GraalVM for Java 22, | ||
// GraalVM 24.0.0), and will be promoted to the default behavior as the community adopts it. | ||
addExperimentalVMOption(nativeImageArgs, "-H:ThrowMissingRegistrationErrors="); |
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.
I am afraid this change could break downstream code. I would put a package filter that handles only Quarkus classes and Quarkus-managed libraries in code that goes to users. Then, we can ask the users in the next release to add --throw-missing-registration-errors=
to their build.
We can use the unfiltered version for internal tests (ideally used with our dev builds). In tests, it is ideally used in combination with -H:MissingRegistrationReportingMode=Exit
to make sure metadata is never missed.
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.
Thanks for the input @vjovanov.
FYI when running without -H:MissingRegistrationReportingMode=Exit
the Quarkus binary exits with error code 1 without printing anything.
When adding -H:MissingRegistrationReportingMode=Exit
I get to see the exception:
org.graalvm.nativeimage.MissingReflectionRegistrationError: The program tried to reflectively access method sun.security.provider.NativePRNG#<init>(java.security.SecureRandomParameters) without it being registered for runtime reflection. Add sun.security.provider.NativePRNG#<init>(java.security.SecureRandomParameters) to the reflection metadata to solve this problem. See https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection for help.
My understanding is that Quarkus catches the exception at some point which results in the error message not being shown, yet it still fails.
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.
My understanding is that Quarkus catches the exception at some point which results in the error message not being shown, yet it still fails.
I would say the same. That is why we introduced -H:MissingRegistrationReportingMode=Exit
.
To speed up the migration you can run the programs with -H:MissingRegistrationReportingMode=Warn
and it will only print the missing elements.
Converting to draft due to #36378 (comment) which requires further investigation. |
bda05ba
to
ff90474
Compare
ff90474
to
5919813
Compare
5919813
to
b35a9cc
Compare
This comment has been minimized.
This comment has been minimized.
31c1600
to
98e0541
Compare
This comment has been minimized.
This comment has been minimized.
This feature will become available as non-experimental in the next release (GraalVM for Java 22), and will be promoted to the default behavior as the community adopts it.
98e0541
to
84e463f
Compare
This comment has been minimized.
This comment has been minimized.
26603b3
to
35501e1
Compare
Status for workflow
|
@zakkak was the feature added in graalVM/Mandrel? |
Yes, but Quarkus is still not ready to enable it by default, I created this PR for testing purposes (but I need to rebase it to the latest We are currently looking into solving the issues related to smallrye config (see #42140 and #44910 which supersedes #42140) |
"This feature will become available as non-experimental in the next release (GraalVM for Java 22), and will be promoted to the default behavior as the community adopts it." -- @vjovanov
See oracle/graal#5173 (comment)