quarkus: Native image build error on Win10
Describe the bug I am running on a Win10 laptop, and tried to build a native image using GraalVM CE 19.2.1 after creating a basic project from https://code.quarkus.io/ (version 1.0.0.RC1) and I get an “augmentation” error. I tried from the Windows command line and from a Git Bash, both result in the same error.
Expected behavior Well, getting a native image generated 😉
Actual behavior
[INFO] --- quarkus-maven-plugin:1.0.0.CR1:build (default) @ code-with-quarkus ---
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Beginning quarkus augmentation
[INFO] [org.jboss.threads] JBoss Threads version 3.0.0.Final
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: C:\Users\vleon\code-with-quarkus\target\code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar\code-with-quarkus-1.0.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from C:\Users\vleon\code-with-quarkus\target\code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar\code-with-quarkus-1.0.0-SNAPSHOT-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on OpenJDK 64-Bit GraalVM CE 19.2.1
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] C:\Users\vleon\graalvm-ce-19.2.1\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 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar code-with-quarkus-1.0.0-SNAPSHOT-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http -H:-JNI -H:-UseServiceLoaderFeature -H:+StackTrace code-with-quarkus-1.0.0-SNAPSHOT-runner
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.364 s
[INFO] Finished at: 2019-11-13T21:09:52+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.0.0.CR1:build (default) on project code-with-quarkus: Failed to build a runnable JAR: Failed to augment application classes: Build failure: Build failed due to errors
[ERROR] [error]: Build step io.quarkus.deployment.pkg.steps.NativeImageBuildStep#build threw an exception: java.lang.RuntimeException: Failed to build native image
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:294)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)
[ERROR] at io.quarkus.deployment.ExtensionLoader$1.execute(ExtensionLoader.java:941)
[ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:415)
[ERROR] at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1535)
[ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1426)
[ERROR] at java.lang.Thread.run(Thread.java:748)
[ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: java.lang.RuntimeException: Image generation failed
[ERROR] at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:283)
[ERROR] ... 12 more
To Reproduce Steps to reproduce the behavior:
- Unzip the attached project code-with-quarkus.zip
- Set the
GRAALVM_HOMEandJAVA_HOMEenv variables, update PATH with the updated JAVA_HOME\bin - Run
mvnw package -Pnative
Environment (please complete the following information):
- OS: Windows 10
- Quarkus: 1.0.0.CR1
- GraalVM: 19.2.1
Additional context Setting env variables this way:
set GRAALVM_HOME=<PATH TO>\graalvm-ce-19.2.1
set JAVA_HOME=<PATH TO>\graalvm-ce-19.2.1
set PATH=%JAVA_HOME%\bin;%PATH%
Attached the full Maven log (with -e option). build_native.txt
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (11 by maintainers)
@gsmet This issue can be closed. It is no longer a problem on Windows.
I created https://github.com/oracle/graal/issues/1843 to have it tracked in Graal
Interestingly, this crash occurs only when
-J-Dio.netty.allocator.maxOrder=1is passed to the native image command. Quarkus sets it by default, so right now that can’t be skipped. Plus, I don’t yet know why setting that param would result in a crash.I didn’t expect that to be honest…
And unfortunately I don’t have a Windows machine to test and reproduce this. I am sure that someone with such a machine will give it a go soon 😉