Open gvolpe opened 5 years ago
Thanks for the comprehensive bug report :hugs:
Do you know what would fix this issue? Why parameters are responsible for the error. The error itself is a bit vague :grimacing:
I've no idea, to be honest. If I remove the graalVMNativeImageOptions
I get this error instead:
[error] Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing scala.reflect.runtime.ReflectionUtils$.reflMethod$Method1(java.lang.Class)
[error] Parsing context:
[error] parsing scala.reflect.runtime.ReflectionUtils$.inferClasspath$1(ReflectionUtils.scala:56)
[error] parsing scala.reflect.runtime.ReflectionUtils$.show(ReflectionUtils.scala:67)
[error] parsing scala.reflect.api.JavaUniverse$JavaMirror.toString(JavaUniverse.scala:60)
[error] parsing scala.reflect.api.JavaUniverse$JavaMirror.toString$(JavaUniverse.scala:60)
[error] parsing scala.reflect.runtime.JavaMirrors$JavaMirror.toString(JavaMirrors.scala:68)
[error] parsing io.netty.util.internal.logging.MessageFormatter.safeObjectAppend(MessageFormatter.java:276)
[error] parsing io.netty.util.internal.logging.MessageFormatter.deeplyAppendParameter(MessageFormatter.java:242)
[error] parsing io.netty.util.internal.logging.MessageFormatter.arrayFormat(MessageFormatter.java:206)
[error] parsing io.netty.util.internal.logging.MessageFormatter.format(MessageFormatter.java:133)
[error] parsing io.netty.util.internal.logging.JdkLogger.debug(JdkLogger.java:206)
[error] parsing io.netty.util.ResourceLeakDetector.<clinit>(ResourceLeakDetector.java:107)
[error] at com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:138)
[error] at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:327)
[error] at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:300)
[error] at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
[error] at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:346)
[error] at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:511)
[error] at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:171)
[error] at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
[error] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
[error] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
[error] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
[error] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
[error] Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: No instances of scala.runtime.StructuralCallSite are allowed in the image heap as this class should be initialized at image runtime. To see how this object got instantiated use -H:+TraceClassInitialization.
[error] at com.oracle.svm.hosted.classinitialization.ClassInitializationFeature.checkImageHeapInstance(ClassInitializationFeature.java:173)
[error] at com.oracle.graal.pointsto.meta.AnalysisUniverse.replaceObject(AnalysisUniverse.java:534)
[error] at com.oracle.svm.hosted.analysis.flow.SVMMethodTypeFlowBuilder.registerUsedElements(SVMMethodTypeFlowBuilder.java:82)
[error] at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:229)
[error] at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:340)
[error] at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:310)
[error] ... 10 more
[error] Error: Image build request failed with exit status 1
[error] stack trace is suppressed; run last core / Graalvm-native-image / packageBin for the full output
[error] (core / Graalvm-native-image / packageBin)
My experience with GraalVM is minimal so I'm just reporting these issues hoping that someone more experienced can shed some light...
@ScalaWilliam did the initial implementation. May he has some light to shed on this :hugs:
Hello! It looks like a Graalvm specific issue. Can you try a previous version of Graalvm?
Sure, any specific version you would recommend? The one mentioned in the documentation seems to have a broken link.
Originally I had set it up against GraalVM 1.0.0-rc8.
However if that doesn't fix it, as from my point of view, the issue is most likely GraalVM-specific, you would be best off to try to run the command directly and report any error to the GraalVM GitHub with a minimum reproducible example. https://github.com/oracle/graal/issues
I have limited time at the moment so am afraid I cannot look into depth at this point - apart from suggest to look at how we construct the graalvm command that we run in sbt-native-packager - see the sources.
Did you have any luck yet @gvolpe?
I have limited time at the moment so am afraid I cannot look into depth at this point
Then thanks a lot for still being active one this issue :hugs:
Did you have any luck yet @gvolpe?
I'm really busy these days as well but I'll try to give this a shot when I get some time, thanks again for your help!
Just as an additional data point, I'm seeing a similar issue trying to build a native image using the 20.0.0 tag of the Graal Image.
There doesn't appear to be an 1.0.0-rc8 on DockerHub anymore, so I tried it with 1.0.0-rc16 but there's no joy there either due to missing the native image update:
[info] Error: Unknown component: native-image
[error] The command 'gu install native-image' returned a non-zero code: 3
[info]
[error] java.lang.RuntimeException: Nonzero exit value when generating GraalVM container build image: 3
[error] at com.typesafe.sbt.packager.graalvmnativeimage.GraalVMNativeImagePlugin$.$anonfun$generateContainerBuildImage$1(GraalVMNativeImagePlugin.scala:174)
[error] at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] at sbt.Execute.$anonfun$submit$2(Execute.scala:281)
[error] at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] at sbt.Execute.work(Execute.scala:290)
[error] at sbt.Execute.$anonfun$submit$1(Execute.scala:281)
[error] at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] at java.lang.Thread.run(Thread.java:748)
Cheers.
@ALPSMAC is native-image
installed? use the given command gu install native-image
to install native-image
and try again
Expected behaviour
sbt 'show graalvm-native-image:packageBin'
generates a Graal Native image usingGraalVM Version 19.3.0 CE
.Actual behaviour
Running
sbt 'show graalvm-native-image:packageBin'
with the following arguments:Gives the following error:
Previously reporting a few warnings such as the ones below:
Information
1.5.0
1.3.1
Ubuntu 19.04
Graal Native Image
rpm --version
):GraalVM Version 19.3.0 CE
Ubuntu 19.04