infinispan / infinispan-quarkus

Infinispan Quarkus based extensions and Server
Apache License 2.0
14 stars 13 forks source link

Windows native build fails #94

Open maledoux opened 2 years ago

maledoux commented 2 years ago

Using latest main branch, tried compiling natively on Windows 10 20H2 and GraalVM 22.1.0

Getting errors with io.netty.channel.epoll on the server-runner compilation

mvn clean install -Dnative -DskipTests


GraalVM Native Image: Generating 'infinispan-quarkus-server-runner-14.0.0.Dev02-runner' (executable)...

[1/7] Initializing... (7.2s @ 0.53GB) Version info: 'GraalVM 22.1.0 Java 11 CE' C compiler: cl.exe (microsoft, x64, 19.29.30140) Garbage collector: Serial GC 3 user-provided feature(s)

Error: Classes that should be initialized at run time got initialized during image building: io.netty.util.AbstractReferenceCounted the class was requested to be initialized at run time (from 'META-INF\native-image\io.netty\common\native-image.properties' in 'file:///C:/Projects/FunFriday/Infinispan/infinispan-quarkus-main/server-runner/target/infinispan-quarkus-server-runner-14.0.0.Dev02-native-image-source-jar/infinispan-quarkus-server-runner-14.0.0.Dev02-runner.jar' with 'io.netty.util.AbstractReferenceCounted'). To see why io.netty.util.AbstractReferenceCounted got initialized use --trace-class-initialization=io.netty.util.AbstractReferenceCounted io.netty.channel.epoll.Epoll the class was requested to be initialized at run time (from feature io.quarkus.runner.AutoFeature.beforeAnalysis with 'Epoll.class'). To see why io.netty.channel.epoll.Epoll got initialized use --trace-class-initialization=io.netty.channel.epoll.Epoll

com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building: io.netty.util.AbstractReferenceCounted the class was requested to be initialized at run time (from 'META-INF\native-image\io.netty\common\native-image.properties' in 'file:///C:/Projects/FunFriday/Infinispan/infinispan-quarkus-main/server-runner/target/infinispan-quarkus-server-runner-14.0.0.Dev02-native-image-source-jar/infinispan-quarkus-server-runner-14.0.0.Dev02-runner.jar' with 'io.netty.util.AbstractReferenceCounted'). To see why io.netty.util.AbstractReferenceCounted got initialized use --trace-class-initialization=io.netty.util.AbstractReferenceCounted io.netty.channel.epoll.Epoll the class was requested to be initialized at run time (from feature io.quarkus.runner.AutoFeature.beforeAnalysis with 'Epoll.class'). To see why io.netty.channel.epoll.Epoll got initialized use --trace-class-initialization=io.netty.channel.epoll.Epoll

    at com.oracle.svm.core.util.UserError.abort(UserError.java:72)
    at com.oracle.svm.hosted.classinitialization.ConfigurableClassInitialization.checkDelayedInitialization(ConfigurableClassInitialization.java:560)
    at com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.duringAnalysis(ClassInitializationFeature.java:167)
    at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$10(NativeImageGenerator.java:726)
    at com.oracle.svm.hosted.FeatureHandler.forEachFeature(FeatureHandler.java:74)
    at com.oracle.svm.hosted.NativeImageGenerator.lambda$runPointsToAnalysis$11(NativeImageGenerator.java:726)
    at com.oracle.graal.pointsto.PointsToAnalysis.runAnalysis(PointsToAnalysis.java:751)
    at com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:723)
    at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:558)
    at com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:515)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:407)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:585)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
    at com.oracle.svm.hosted.NativeImageGeneratorRunner$JDK9Plus.main(NativeImageGeneratorRunner.java:615)

[INFO] Infinispan Quarkus :: Server Runner ................ FAILURE [ 39.211 s]

maledoux commented 2 years ago

I added this to my server-runner/src/main/resources/application.properties to get rid of the errors.

quarkus.native.additional-build-args=--initialize-at-run-time=io.lettuce.core.resource.Transports$NativeTransports\,io.lettuce.core.resource.EpollProvider\,o.netty.channel.epoll.Epoll\,io.netty.channel.DefaultFileRegion\,io.netty.util.AbstractReferenceCounted\,io.netty.channel.DefaultFileRegion\,io.netty.channel.epoll.Native\,io.netty.channel.epoll.Epoll\,io.netty.channel.epoll.EpollEventLoop\,io.netty.channel.epoll.EpollEventArray\,io.netty.channel.kqueue.KQueue\,io.netty.channel.kqueue.KQueueEventLoop\,io.netty.channel.kqueue.KQueueEventArray\,io.netty.channel.kqueue.Native\,io.netty.channel.unix.Limits\,io.netty.channel.unix.Errors\,io.netty.channel.unix.IovArray