-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Describe the issue
Native image fails to build due to a static field in a record class: https://github.com/Minestom/Minestom/blob/0b4dd3b8aa4661a8c389833c3095927c9c90d98e/src/main/java/net/minestom/server/network/packet/client/login/EncryptionResponsePacket.java#L29
Steps to reproduce the issue
- clone https://github.com/Minestom/Minestom/tree/0b4dd3b8aa4661a8c389833c3095927c9c90d98e
- run
gradle shadowJar
to build the archive - run
native-image -jar minestom-demo.jar --allow-incomplete-classpath
in the archive path (Minestom/demo/build/libs
)
Describe GraalVM and your environment:
- GraalVM version: CE 22.0.0.2
- JDK major version: 17
- OS: Linux/PopOS
- Architecture: AMD64
More details
Fatal error: java.lang.UnsupportedOperationException: can't get base address on a record class: private static final java.lang.String net.minestom.server.network.packet.client.login.EncryptionResponsePacket.MOJANG_AUTH_URL
at jdk.unsupported/sun.misc.Unsafe.staticFieldBase(Unsafe.java:705)
at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.readUninitializedStaticValue(AnalysisConstantReflectionProvider.java:152)
at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.readValue(AnalysisConstantReflectionProvider.java:88)
at com.oracle.svm.hosted.ameta.AnalysisConstantReflectionProvider.readFieldValue(AnalysisConstantReflectionProvider.java:81)
at com.oracle.graal.pointsto.ObjectScanner.scanField(ObjectScanner.java:153)
at com.oracle.graal.pointsto.ObjectScanner.scanRootField(ObjectScanner.java:140)
at com.oracle.graal.pointsto.ObjectScanner.lambda$scanBootImageHeapRoots$0(ObjectScanner.java:94)
at com.oracle.graal.pointsto.ObjectScanner.lambda$execute$5(ObjectScanner.java:112)
at com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:195)
at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:179)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool.externalHelpQuiescePool(ForkJoinPool.java:2104)
at java.base/java.util.concurrent.ForkJoinPool.awaitQuiescence(ForkJoinPool.java:3321)
at com.oracle.graal.pointsto.util.CompletionExecutor.complete(CompletionExecutor.java:245)
at com.oracle.graal.pointsto.PointsToAnalysis.checkObjectGraph(PointsToAnalysis.java:683)
at com.oracle.graal.pointsto.PointsToAnalysis.finish(PointsToAnalysis.java:647)
at com.oracle.graal.pointsto.PointsToAnalysis.runAnalysis(PointsToAnalysis.java:734)
at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:702)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:537)
at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:494)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:426)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:587)
at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:126)
at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:617)