retrogradeorbit / bootleg

Simple template processing command line tool to help build static websites
Eclipse Public License 2.0
256 stars 12 forks source link

Build failed when trying build with graalvm-ce-java11-19.3.0 #47

Closed agilecreativity closed 4 years ago

agilecreativity commented 4 years ago

First of all, thanks for the great project.

When trying to build with graalvm-ce-java11-19.3.0 on OSX it seems to be error. It works perfectly when trying with graalvm-ce-java8-19.3.0. I will add the stacktrace of the problem once I have test this again soon. This is the result of running the following command: My environment:

The relevant error logs:

... Printing initializer configuration to /Users/bchoomnuan/apps/retrogradeorbit--bootleg/reports/initializer_configuration_20191218_213958.txt [Use -Dgraal.LogFile= to redirect Graal log output to a file.] [thread:24] scope: ForkJoinPool-2-worker-7 [thread:24] scope: ForkJoinPool-2-worker-7.ClosedWorldAnalysis Context: StructuredGraph:4804{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>} Context: AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>> [thread:24] scope: ForkJoinPool-2-worker-7.ClosedWorldAnalysis.AnalysisGraphBuilderPhase.IntrinsifyMethodHandles Context: StructuredGraph:4820{HotSpotMethod<Invokers$Holder.invoke_MT(Object, Object, Object, Object)>} Exception raised in scope ForkJoinPool-2-worker-7.ClosedWorldAnalysis.AnalysisGraphBuilderPhase.IntrinsifyMethodHandles: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object) To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed. at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.processInvokeWithMethodHandle(IntrinsifyMethodHandlesInvocationPlugin.java:483) at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.handleInvoke(IntrinsifyMethodHandlesInvocationPlugin.java:194) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.tryNodePluginForInvocation(BytecodeParser.java:2110) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1793) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genDynamicInvokeHelper(BytecodeParser.java:1682) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1630) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1615) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5168) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3286) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3093) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:977) at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:871) at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84) at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49) at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197) at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42) at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38) at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:221) at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:340) at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:310) at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:300) at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107) at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:346) at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:511) at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:171) at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

  Context obj StructuredGraph:4820{HotSpotMethod<Invokers$Holder.invoke_MT(Object, Object, Object, Object)>}
  Context obj com.oracle.svm.hosted.phases.AnalysisGraphBuilderPhase@7f0b3701
  Context obj StructuredGraph:4804{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>}
  Context obj AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>
  Context obj com.oracle.svm.hosted.analysis.flow.SVMMethodTypeFlowBuilder@19bd70c
Exception raised in scope ForkJoinPool-2-worker-7.ClosedWorldAnalysis.AnalysisGraphBuilderPhase: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
    at parsing clojure.lang.Reflector.canAccess(Reflector.java:49)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2475)
    at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:93)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3291)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3093)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:977)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:871)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:84)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:197)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:42)
    at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.apply(Phase.java:38)
    at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.parse(MethodTypeFlowBuilder.java:221)
    at com.oracle.graal.pointsto.flow.MethodTypeFlowBuilder.apply(MethodTypeFlowBuilder.java:340)
    at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:310)
    at com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureParsed(MethodTypeFlow.java:300)
    at com.oracle.graal.pointsto.flow.MethodTypeFlow.addContext(MethodTypeFlow.java:107)
    at com.oracle.graal.pointsto.flow.StaticInvokeTypeFlow.update(InvokeTypeFlow.java:346)
    at com.oracle.graal.pointsto.BigBang$2.run(BigBang.java:511)
    at com.oracle.graal.pointsto.util.CompletionExecutor.lambda$execute$0(CompletionExecutor.java:171)
    at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1426)
    at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
    at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
    at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
    at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
    at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Invoke with MethodHandle argument could not be reduced to at most a single call: java.lang.invoke.Invokers$Holder.invoke_MT(Object, Object, Object, Object)
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The error is then reported at run time when the invoke is executed.
    at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.processInvokeWithMethodHandle(IntrinsifyMethodHandlesInvocationPlugin.java:483)
    at com.oracle.svm.hosted.phases.IntrinsifyMethodHandlesInvocationPlugin.handleInvoke(IntrinsifyMethodHandlesInvocationPlugin.java:194)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.tryNodePluginForInvocation(BytecodeParser.java:2110)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1793)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genDynamicInvokeHelper(BytecodeParser.java:1682)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1630)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1615)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5168)
    at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3286)
    ... 22 more

Context obj com.oracle.svm.hosted.phases.AnalysisGraphBuilderPhase@7f0b3701
Context obj StructuredGraph:4804{AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>}
Context obj AnalysisMethod<Reflector.canAccess -> HotSpotMethod<Reflector.canAccess(Method, Object)>>
Context obj com.oracle.svm.hosted.analysis.flow.SVMMethodTypeFlowBuilder@19bd70c
retrogradeorbit commented 4 years ago

Thanks for the report. Use java8 for the time being. I will try it with java 11 when I get a chance.

Just curious as to the reason to compile it against graal java 11? Just to be up to date?

agilecreativity commented 4 years ago

No particular reason really. But just happen to download it first. Now I am back to use Java 8 and it works perfectly. Thanks

retrogradeorbit commented 4 years ago

Have recreated this. And narrowed it down to this piece of code inside clojure that is triggering it:

https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Reflector.java#L49

borkdude commented 4 years ago

I have a working branch for babashka and sci with jdk11. The workarounds are:

With these two fixes it should work. See:

https://github.com/borkdude/sci/compare/jdk11

JDK11 is work in progress for babashka. The issue about it is here: https://github.com/borkdude/babashka/issues/120

The only remaining issue is packaging java.nio files in reflection.json doesn't work on JDK11 with macOS. This should be fixed in graalvm 20.

retrogradeorbit commented 4 years ago

Fixed in v0.1.8