Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus Native Image build on Windows fails #8256

Closed
38leinaD opened this issue Mar 29, 2020 · 4 comments
Closed

Quarkus Native Image build on Windows fails #8256

38leinaD opened this issue Mar 29, 2020 · 4 comments
Labels
env/windows Impacts Windows machines kind/question Further information is requested

Comments

@38leinaD
Copy link
Contributor

Describe the bug
I am currently trying to evaluate if Github Actions can be used to build Quarkus Native Images for all major operating system. Linux and MacOS work find. Only the Windows build fails with.

Build Result

Warning: the '=' character in program arguments is not fully supported.
Make sure that command line arguments using it are wrapped in double quotes.
Example:
"--vm.Dfoo=bar"

[quarkus-with-gh-actions-999-SNAPSHOT-runner:1376]    classlist:   5,473.12 ms
[quarkus-with-gh-actions-999-SNAPSHOT-runner:1376]        (cap):  14,294.62 ms
[quarkus-with-gh-actions-999-SNAPSHOT-runner:1376]        setup:  16,185.96 ms
Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing io.quarkus.runtime.configuration.ExpandingConfigSource.isExpanding() 
[quarkus-with-gh-actions-999-SNAPSHOT-runner:1376]     analysis:  16,043.98 ms
Parsing context:
parsing io.quarkus.runtime.configuration.ExpandingConfigSource.getValue(ExpandingConfigSource.java:47)
  parsing io.smallrye.config.SmallRyeConfig.getRawValue(SmallRyeConfig.java:121)
  parsing io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:84)
  parsing io.quarkus.runtime.generated.Config.initGroup$io$quarkus$runtime$ThreadPoolConfig(Config.zig:183)
  parsing io.quarkus.runtime.generated.Config.readConfig(Config.zig:15671)
  parsing io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(RuntimeConfigSetup.zig:38)
  parsing io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:66)
  parsing io.quarkus.runtime.Application.start(Application.java:90)
  parsing io.quarkus.runtime.Application.run(Application.java:228)
  parsing io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)
  parsing com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:151)
  parsing com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:186)
  parsing com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)

  at com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:138)
  at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:323)
  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: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.svm.core.util.VMError$HostedError: Accessed VMThreadLocal is not a compile time constant: io.quarkus.runtime.configuration.Substitutions$Target_ExpandingConfigSource.isExpanding(Substitutions.java:60) - node 6|LoadField#notExpanding
  at parsing io.quarkus.runtime.configuration.Substitutions$Target_ExpandingConfigSource.isExpanding(Substitutions.java:60)
  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)
  ... 11 more
  Caused by: com.oracle.svm.core.util.VMError$HostedError: Accessed VMThreadLocal is not a compile time constant: io.quarkus.runtime.configuration.Substitutions$Target_ExpandingConfigSource.isExpanding(Substitutions.java:60) - node 6|LoadField#notExpanding
  at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:66)
  at com.oracle.svm.hosted.thread.VMThreadLocalCollector.findInfo(VMThreadLocalCollector.java:85)
  at com.oracle.svm.hosted.thread.VMThreadMTFeature.handleGet(VMThreadMTFeature.java:213)
  at com.oracle.svm.hosted.thread.VMThreadMTFeature.access$300(VMThreadMTFeature.java:74)
  at com.oracle.svm.hosted.thread.VMThreadMTFeature$5.apply(VMThreadMTFeature.java:159)
  at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.execute(InvocationPlugin.java:191)
  at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.tryInvocationPlugin(BytecodeParser.java:2097)
  at com.oracle.svm.hosted.phases.AnalysisGraphBuilderPhase$AnalysisBytecodeParser.tryInvocationPlugin(AnalysisGraphBuilderPhase.java:67)
  at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1806)
  at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genDynamicInvokeHelper(BytecodeParser.java:1680)
  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

If you look at the repo you will see: It is Quarkus 1.3.1; and the build is based on Gradle which should not make a different. Due to the problem describe here, i am not invoking the gradle-task to build the image, but native-image directly.

I am seeing the same issue on graal 19.3.1-java11 and graal 20.0.0-java11. The issue is only on Windows. With 19.3.1 on Linux and MacOs there is no problem.
With the java8 equivalent i am not even getting this far. Native Image failed without much output but only an obscure error-code Build with graalvm-19.3.1-java8
To the best of my knowledge the windows runner used by Github Actions has all that is needed installed (What's needed?): Visual Studio 2017 Enterprise Edition.

To Reproduce
Steps to reproduce the behavior:

  1. Fork 38leinaD/quarkus-with-gh-actions
  2. Activate Github "Actions" for your fork and trigger the build via creating a "Release" ("Draft a New Release" button).

Environment (please complete the following information):

  • GraalVM version 19.3.1-java11
  • Quarkus version or git rev: 1.3.0
  • Build tool (ie. output of mvnw --version or gradlew --version): gradle

Maybe someone has an idea/tip. I think it would be quiet nice if Github Actions could be used to build native binaries for all major platforms...

@38leinaD 38leinaD added the kind/bug Something isn't working label Mar 29, 2020
@quarkusbot quarkusbot added the env/windows Impacts Windows machines label Mar 29, 2020
@geoand
Copy link
Contributor

geoand commented Mar 30, 2020

Hi,

Can you please give version 1.3.1.Final a try?
I remember there were some Windows related fixes.

@38leinaD
Copy link
Contributor Author

I am sorry, i wrote down the wrong version. I am actually already using 1.3.1.Final.
I am also seeing the issue locally. Did the steps as listed here: oracle/graal#1852 (comment)

Running like this:

call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
C:\junk\graalvm-ce-java11-windows-amd64-20.0.0\graalvm-ce-java11-20.0.0\bin\native-image.cmd "-J-Dsun.nio.ch.maxUpdateArraySize=100" "-J-Djava.util.logging.manager=org.jboss.logmanager.LogManager" "-J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory" "-J-Dvertx.disableDnsResolver=true" "-J-Dio.netty.leakDetection.level=DISABLED" "-J-Dio.netty.allocator.maxOrder=1" "-J-Duser.language=en" "-J-Dfile.encoding=Cp1252" "--initialize-at-build-time= "  "-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime" "-H:+JNI" -jar quarkus-with-gh-actions-999-SNAPSHOT-runner.jar "-H:FallbackThreshold=0" -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:-IncludeAllTimeZones -H:-SpawnIsolates -H:-UseServiceLoaderFeature -H:+StackTrace quarkus-with-gh-actions-999-SNAPSHOT-runner 

Result:

Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
[quarkus-with-gh-actions-999-SNAPSHOT-runner:12012]    classlist:   4,880.85 ms,  1.20 GB
[quarkus-with-gh-actions-999-SNAPSHOT-runner:12012]        (cap):  12,390.31 ms,  1.20 GB
[quarkus-with-gh-actions-999-SNAPSHOT-runner:12012]        setup:  21,104.18 ms,  1.20 GB
[quarkus-with-gh-actions-999-SNAPSHOT-runner:12012]     analysis:  11,732.33 ms,  1.44 GB
Fatal error: com.oracle.graal.pointsto.util.AnalysisError$ParsingError: Error encountered while parsing io.quarkus.runtime.configuration.ExpandingConfigSource.isExpanding()
Parsing context:
        parsing io.quarkus.runtime.configuration.ExpandingConfigSource.getValue(ExpandingConfigSource.java:47)
        parsing io.smallrye.config.SmallRyeConfig.getRawValue(SmallRyeConfig.java:121)
        parsing io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:84)
        parsing io.quarkus.runtime.generated.Config.initGroup$io$quarkus$vertx$core$runtime$config$VertxConfiguration(Config.zig:26602)
        parsing io.quarkus.runtime.generated.Config.readConfig(Config.zig:15621)
        parsing io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(RuntimeConfigSetup.zig:38)
        parsing io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:74)
        parsing io.quarkus.runtime.Application.start(Application.java:90)
        parsing io.quarkus.runtime.Application.run(Application.java:228)
        parsing io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)
        parsing com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:151)
        parsing com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:186)
        parsing com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)

        at com.oracle.graal.pointsto.util.AnalysisError.parsingError(AnalysisError.java:138)
        at com.oracle.graal.pointsto.flow.MethodTypeFlow.doParse(MethodTypeFlow.java:323)
        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: org.graalvm.compiler.java.BytecodeParser$BytecodeParserError: com.oracle.svm.core.util.VMError$HostedError: Accessed VMThreadLocal is not a compile time constant: io.quarkus.runtime.configuration.Substitutions$Target_ExpandingConfigSource.isExpanding(Substitutions.java:60) - node 6|LoadField#notExpanding
        at parsing io.quarkus.runtime.configuration.Substitutions$Target_ExpandingConfigSource.isExpanding(Substitutions.java:60)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.throwParserError(BytecodeParser.java:2582)
        at com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.throwParserError(SharedGraphBuilderPhase.java:94)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3402)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3204)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1085)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:979)
        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)
        ... 11 more
Caused by: com.oracle.svm.core.util.VMError$HostedError: Accessed VMThreadLocal is not a compile time constant: io.quarkus.runtime.configuration.Substitutions$Target_ExpandingConfigSource.isExpanding(Substitutions.java:60) - node 6|LoadField#notExpanding
        at com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:66)
        at com.oracle.svm.hosted.thread.VMThreadLocalCollector.findInfo(VMThreadLocalCollector.java:85)
        at com.oracle.svm.hosted.thread.VMThreadMTFeature.handleGet(VMThreadMTFeature.java:213)
        at com.oracle.svm.hosted.thread.VMThreadMTFeature.access$300(VMThreadMTFeature.java:74)
        at com.oracle.svm.hosted.thread.VMThreadMTFeature$5.apply(VMThreadMTFeature.java:159)
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.execute(InvocationPlugin.java:191)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.tryInvocationPlugin(BytecodeParser.java:2204)
        at com.oracle.svm.hosted.phases.AnalysisGraphBuilderPhase$AnalysisBytecodeParser.tryInvocationPlugin(AnalysisGraphBuilderPhase.java:67)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.appendInvoke(BytecodeParser.java:1914)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genDynamicInvokeHelper(BytecodeParser.java:1788)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1738)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeVirtual(BytecodeParser.java:1723)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5286)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3397)
        ... 22 more
Error: Image build request failed with exit status 1

@38leinaD
Copy link
Contributor Author

So, the execption looks to be the same as here: #6884
But this is under ubuntu and not Winodws. According to that issue, it got resolved after installing some library dependencies (sudo apt-get -y install gcc libc6-dev zlib1g-dev).
I am not expert on graalvm. Does this in some give a hint to my problem? am i missing some libraries? Did i miss to install some part of VisualStudio?

@38leinaD
Copy link
Contributor Author

This issue can be closed. I think i did a mistake. See explaination here: https://groups.google.com/forum/#!topic/quarkus-dev/kC3vhDyuNuQ

@gsmet gsmet added kind/question Further information is requested and removed kind/bug Something isn't working labels Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
env/windows Impacts Windows machines kind/question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants