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

Handle -H:±UnlockExperimentalVMOptions warning due to -H:ReflectionConfigurationResources when compiling native applications in Java with GraalVM 23.1+ #4316

Closed
vincejv opened this issue Nov 5, 2023 · 1 comment
Labels
duplicate A duplicate of another issue

Comments

@vincejv
Copy link

vincejv commented Nov 5, 2023

Please describe the feature request.
Getting a warning during native image compilation when io.micrometer:micrometer-registry-prometheus:1.11.5 is included as a dependency in GraalVM Native image builds

#17 4.578 Welcome to Gradle 8.3!
#17 4.579 
#17 4.579 Here are the highlights of this release:
#17 4.581  - Faster Java compilation
#17 4.582  - Reduced memory usage
#17 4.584  - Support for running on Java 20
#17 4.585 
#17 4.586 For more details see https://docs.gradle.org/8.3/release-notes.html
#17 4.587 
#17 4.777 Starting a Gradle Daemon (subsequent builds will be faster)
#17 33.28 > Task :processResources
#17 46.88 > Task :quarkusGenerateCode
#17 47.78 > Task :quarkusGenerateCodeDev
#17 56.58 > Task :compileJava
#17 56.58 > Task :classes
#17 56.68 > Task :jar
#17 56.68 > Task :compileQuarkusTestGeneratedSourcesJava NO-SOURCE
#17 57.28 > Task :quarkusGenerateCodeTests
#17 57.28 > Task :compileTestJava NO-SOURCE
#17 57.28 > Task :processTestResources NO-SOURCE
#17 57.28 > Task :testClasses UP-TO-DATE
#17 57.28 > Task :test NO-SOURCE
#17 65.08 Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.micrometer/micrometer-core/reflect-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
#17 65.08 Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.netty/netty-transport/reflection-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
#17 65.08 Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
#17 75.18 ========================================================================================================================
#17 75.18 GraalVM Native Image: Generating 'qbittorrent-exporter-unspecified-runner' (executable)...
#17 75.18 ========================================================================================================================
#17 75.18 For detailed information and explanations on the build output, visit:
#17 75.18 https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md
#17 75.19 ------------------------------------------------------------------------------------------------------------------------
#17 80.28 [1/8] Initializing...                                                                                   (12.8s @ 0.12GB)
#17 80.28  Java version: 21.0.1+12-LTS, vendor version: Mandrel-23.1.1.0-Final
#17 80.28  Graal compiler: optimization level: 2, target machine: compatibility
#17 80.28  C compiler: gcc (redhat, x86_64, 8.5.0)
#17 80.28  Garbage collector: Serial GC (max heap size: 80% of RAM)
#17 80.28  3 user-specific feature(s):
#17 80.28  - com.oracle.svm.thirdparty.gson.GsonFeature
#17 80.28  - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
#17 80.28  - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase
#17 80.28 ------------------------------------------------------------------------------------------------------------------------
#17 80.28  5 experimental option(s) unlocked:
#17 80.28  - '-H:+IncludeAllLocales' (origin(s): command line)
#17 80.28  - '-H:+AllowFoldMethods' (origin(s): command line)
#17 80.28  - '-H:BuildOutputJSONFile' (origin(s): command line)
#17 80.28  - '-H:-UseServiceLoaderFeature' (origin(s): command line)
#17 80.28  - '-H:ReflectionConfigurationResources' (origin(s): 'META-INF/native-image/io.micrometer/micrometer-core/native-image.properties' in 'file:///code/build/qbittorrent-exporter-unspecified-native-image-source-jar/lib/io.micrometer.micrometer-core-1.11.1.jar', 'META-INF/native-image/io.netty/netty-transport/native-image.properties' in 'file:///code/build/qbittorrent-exporter-unspecified-native-image-source-jar/lib/io.netty.netty-transport-4.1.100.Final.jar')
#17 80.28 ------------------------------------------------------------------------------------------------------------------------
#17 80.28 Build resources:

Rationale
As per oracle/graal#7105, you will need to wrap -H:±UnlockExperimentalVMOptions when using -H:ReflectionConfigurationResources or else io.micrometer:micrometer-registry-prometheus will no longer work in future GraalVM versions

Additional context
oracle/graal#7105
Karm/mandrel-integration-tests#184
quarkusio/quarkus#35772
quarkusio/quarkus#35788
oracle/graal#7370
oracle/graal#7709

@vincejv vincejv changed the title Handle -H:+UnlockExperimentalVMOptions when compiling native application in Java with GraalVM 23.1+ Handle -H:+UnlockExperimentalVMOptions when compiling native applications in Java with GraalVM 23.1+ Nov 5, 2023
@vincejv vincejv changed the title Handle -H:+UnlockExperimentalVMOptions when compiling native applications in Java with GraalVM 23.1+ Handle -H:±UnlockExperimentalVMOptions when compiling native applications in Java with GraalVM 23.1+ Nov 5, 2023
@vincejv vincejv changed the title Handle -H:±UnlockExperimentalVMOptions when compiling native applications in Java with GraalVM 23.1+ -H:±UnlockExperimentalVMOptions warning due to -H:ReflectionConfigurationResources when compiling native applications in Java with GraalVM 23.1+ Nov 5, 2023
@vincejv vincejv changed the title -H:±UnlockExperimentalVMOptions warning due to -H:ReflectionConfigurationResources when compiling native applications in Java with GraalVM 23.1+ Handle -H:±UnlockExperimentalVMOptions warning due to -H:ReflectionConfigurationResources when compiling native applications in Java with GraalVM 23.1+ Nov 5, 2023
@shakuzen
Copy link
Member

shakuzen commented Nov 6, 2023

Thank you for the detailed report with all the references.

The warning has been obviated with #4245 for our upcoming 1.12.0 release. As for prior Micrometer release lines, I'm not sure we should do anything. There is no warning in release lines of GraalVM released at the time of our corresponding minor releases and in the current GraalVM version it is only a warning. If users want to use the latest GraalVM native image without warnings, upgrading to Micrometer 1.12.0 (scheduled to be released next week) seems like a reasonable answer. As can be seen in the above linked issue, our only use of options was in a native-image.properties file, and we cannot add -H:+UnlockExperimentalVMOptions there because it won't be recognized by prior versions of GraalVM.

I'm closing this as a duplicate of #4245. Let us know if you think we should still do something about this (beyond #4245), and we can consider reopening the issue.

Duplicate of #4245

@shakuzen shakuzen closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2023
@shakuzen shakuzen added duplicate A duplicate of another issue and removed waiting-for-triage labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate A duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants