Open GrapeBaBa opened 9 months ago
Hi, Thank you for reaching out, did you try generating the configuration files using our Tracing agent? If not, please do so and check this doc for details: https://www.graalvm.org/22.3/reference-manual/native-image/metadata/AutomaticMetadataCollection/
Thanks for reporting this issue, adding more instructions would help reproduce this issue: which subproject, how to run, etc. Also, does this happen with the statically linked binary or with the regular one?
I would run the build with the latest GraalVM version (snapshot ideally) and add the flag -H:ThrowMissingRegistrationErrors=
to see if it fails. Also, it would be good to have the output of -H:+PrintClassInitialization
.
Thanks for reporting this issue, adding more instructions would help reproduce this issue: which subproject, how to run, etc. Also, does this happen with the statically linked binary or with the regular one?
I would run the build with the latest GraalVM version (snapshot ideally) and add the flag
-H:ThrowMissingRegistrationErrors=
to see if it fails. Also, it would be good to have the output of-H:+PrintClassInitialization
.
will do and feedback.
Hi, Thank you for reaching out, did you try generating the configuration files using our Tracing agent? If not, please do so and check this doc for details: https://www.graalvm.org/22.3/reference-manual/native-image/metadata/AutomaticMetadataCollection/
Yes, we generated the files and works fine. Only this code seems not execution when compile to native.
Thanks for reporting this issue, adding more instructions would help reproduce this issue: which subproject, how to run, etc. Also, does this happen with the statically linked binary or with the regular one?
I would run the build with the latest GraalVM version (snapshot ideally) and add the flag
-H:ThrowMissingRegistrationErrors=
to see if it fails. Also, it would be good to have the output of-H:+PrintClassInitialization
.
@vjovanov it is easy to build and run, however it need some env config which include API key, how can I share it to you. And does this flag-H:ThrowMissingRegistrationErrors=
need pass class name? I am using Oracle GraalVM 21.0.2+13.1 right now.
If only for build the native and don't run it, you can do below.
clone hildr
cd hildr
./gradlew :hildr-node:buildBinary
The native image gradle task is here https://github.com/optimism-java/hildr/blob/main/hildr-node/build.gradle#L349
Add -H:+PrintClassInitialization
in my laptop , I see this info in the file class_initialization_report_20240225_163709.csv, it seems the class is initialized.
io.libp2p.pubsub.PubsubApiImpl, BUILD_TIME, class proven as side-effect free before analysis io.libp2p.pubsub.PubsubApiImpl$1, BUILD_TIME, class proven as side-effect free before analysis io.libp2p.pubsub.PubsubApiImpl$PublisherImpl, BUILD_TIME, class proven as side-effect free before analysis io.libp2p.pubsub.PubsubApiImpl$SubscriptionImpl, BUILD_TIME, class proven as side-effect free before analysis io.libp2p.pubsub.PubsubApiImpl$onNewMessage$1, BUILD_TIME, class proven as side-effect free before analysis io.libp2p.pubsub.PubsubApiImpl$validationResultReduce$1, BUILD_TIME, class proven as side-effect free before analysis
-H:ThrowMissingRegistrationErrors=
is a build-time flag that throws when there is missing reflection metadata. It can be used in conjunction with -H:MissingRegistrationReportingMode=Warn
to print missing elements, or -H:MissingRegistrationReportingMode=Exit
to hard fail on missing elements.
I feel it is possible a problem with network layer since it is a p2p library based UDP. Is there anything I need to pay attention to in such case?
Is the reflection configured properly? No exceptions when you use: -H:ThrowMissingRegistrationErrors=
?
If no exceptions, you can send me the keys over the community slack: Slack channels
Describe the issue Our project https://github.com/optimism-java/hildr using https://github.com/libp2p/jvm-libp2p as dependency. When build as a jar, it works fine. After build as native, a method https://github.com/libp2p/jvm-libp2p/blob/24982eee203f72a96769fc103195c9807c61f425/libp2p/src/main/kotlin/io/libp2p/pubsub/PubsubApiImpl.kt#L64 seems not be called and no exception thrown.
Steps to reproduce the issue Please include both build steps as well as run steps
Describe GraalVM and your environment:
More details Add any other information about the problem here. Especially important are stack traces or log output. Feel free to link to gists or to screenshots if necessary.