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

[GR-41978] Disallow --initialize-at-build-time without arguments. #5266

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Oct 21, 2022

Using --initialize-at-build-time= without a package or class name is problematic because it does not compose, i.e., a single library can make assumptions that the whole classpath can be safely initialized at build time. That assumption is often incorrect.

Since GraalVM 21.3, a warning message is printed when --initialize-at-build-time= is used. This PR converts the warning to an error.

One exception where --initialize-at-build-time= is allowed is the command line, i.e., if you have an application where you know the application and all its dependencies are safe for initialization at build time, then --initialize-at-build-time= can be provided on the command line.

@tomas-langer One known problematic usage is in Helidon MP: https://github.com/helidon-io/helidon/blob/helidon-3.x/microprofile/cdi/src/main/resources/META-INF/native-image/io.helidon.microprofile.cdi/helidon-microprofile-cdi/native-image.properties#L18
All other tests that we have in our test infrastructure passed without the new flag to temporarily convert the error back to a warning.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 21, 2022
@graalvmbot graalvmbot force-pushed the cwi/GR-41978-initialize-at-build-time branch from 344b369 to 6572124 Compare October 21, 2022 20:53
@graalvmbot graalvmbot force-pushed the cwi/GR-41978-initialize-at-build-time branch from 6572124 to 8ad5d4e Compare October 26, 2022 17:00
@graalvmbot graalvmbot closed this Oct 26, 2022
@graalvmbot graalvmbot deleted the cwi/GR-41978-initialize-at-build-time branch October 26, 2022 18:21
@graalvmbot graalvmbot merged commit 0f76434 into master Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants