-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support GraalVM / native image builds using the GraalVM Java 11 build #5682
Comments
@Sanne Do you plan on working on this one or can I give it a go at the end of my day? |
It will be at least ~5 days until I have time to open my IDE again :-/ Feel free to try! And don't hesitate to ask for help. |
A quick run using:
➜ library-svc git:(master) ✗ ./mvnw verify -Pnative
...
[INFO] --- quarkus-maven-plugin:1.0.0.CR2:native-image (default) @ library-svc ---
[INFO] [org.hibernate.jpa.boot.internal.PersistenceXmlParser] HHH000318: Could not find any META-INF/persistence.xml file in the classpath
[INFO] [org.hibernate.Version] HHH000412: Hibernate Core {5.4.9.Final}
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building native image source jar: /home/mariusi/dev/devisions/eda_playground/library-svc/target/library-svc-0.1-native-image-source-jar/library-svc-0.1-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Building native image from /home/mariusi/dev/devisions/eda_playground/library-svc/target/library-svc-0.1-native-image-source-jar/library-svc-0.1-runner.jar
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on OpenJDK 64-Bit Server VM
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] /home/mariusi/apps/graalvm/graalvm-ce-19.3.0/bin/native-image -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime -jar library-svc-0.1-runner.jar -J-Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http,https --enable-all-security-services -H:NativeLinkerOption=-no-pie -H:+JNI --no-server -H:-UseServiceLoaderFeature -H:+StackTrace library-svc-0.1-runner
[library-svc-0.1-runner:13745] classlist: 9,009.22 ms
[library-svc-0.1-runner:13745] setup: 353.40 ms
Error: substitution target for io.quarkus.vertx.core.runtime.graal.Target_sun_misc_URLClassPath is not loaded. Use field `onlyWith` in the `TargetClass` annotation to make substitution only active when needed.
com.oracle.svm.core.util.UserError$UserException: substitution target for io.quarkus.vertx.core.runtime.graal.Target_sun_misc_URLClassPath is not loaded. Use field `onlyWith` in the `TargetClass` annotation to make substitution only active when needed.
at com.oracle.svm.core.util.UserError.abort(UserError.java:65)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.findTargetClass(AnnotationSubstitutionProcessor.java:823)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.handleClass(AnnotationSubstitutionProcessor.java:252)
at com.oracle.svm.hosted.substitute.AnnotationSubstitutionProcessor.init(AnnotationSubstitutionProcessor.java:230)
at com.oracle.svm.hosted.NativeImageGenerator.createDeclarativeSubstitutionProcessor(NativeImageGenerator.java:876)
at com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:825)
at com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:528)
at com.oracle.svm.hosted.NativeImageGenerator.lambda$run$0(NativeImageGenerator.java:445)
at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1407)
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)
Error: Image build request failed with exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.849 s
[INFO] Finished at: 2019-11-22T15:40:13+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.0.0.CR2:native-image (default) on project library-svc: Failed to generate a native image: 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:289)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[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.base/java.lang.Thread.run(Thread.java:834)
[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:278)
[ERROR] ... 12 more
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
➜ library-svc git:(master) ✗ |
@DEVisions that specific issue looks like it has been fixed by #5336, but looks to be currently targeted for the |
As soon as we have a clean test run, we should start the process of requiring JDK 11 by printing a deprecation warning when JDK 8 is used. |
@DEVisions @zeldanerd24 Quarkus |
@gwenneg Thanks for the feedback also. I am interested of getting the native image of a Java |
If you want to run an early test with Quarkus I'll let @gsmet answer the ETA question :) |
@gwenneg Yes, please. Thank you. |
Quarkus is now 1.0!!! Hooray!!! 😄 |
@DEVisions well, it will be solved when we will have fixed all the remaining issues :). Hopefully for 1.1.0, which is planned for mid-december but we will see. Keep in mind that GraalVM + JDK 11 is in tech preview, as per the GraalVM team. |
@DEVisions: This issue has been closed automatically because of the merge of #5854, but the Quarkus compatibility with GraalVM |
@gwenneg Great, appreciate it! Thanks a lot! |
I'm reopening this one. In any case, it will need documentation, tests and so on. |
I created a GraalVM issue tonight about the remaining problem in Quarkus with JDK 11: oracle/graal#1941. I'm not sure whether the cause is in Quarkus or in GraalVM. Debugging the native image generation didn't give much information so far because the issue is happening with a proxied annotation (and I couldn't tell what was the proxy target interface from the debugging data). I'll take another look at it tomorrow. |
It seems I found the cause and it looks very much like a GraalVM bug. The good news is that there's an easy and harmless workaround in Quarkus so it shouldn't be a problem for our GraalVM 19.3.0 JDK 11 support :) This needs to be confirmed with some extensive tests which I will run tomorrow. |
@gsmet: How would you like to communicate in the doc about the GraalVM + JDK 11 support in Quarkus? Since CI doesn't run JDK 11 native tests for now, I suppose we can't just write that we provide a production-grade support. Should it be qualified as |
@gwenneg well, GraalVM says the JDK 11 support is preview for them so it will be for us too. That being said, we need to tackle the CI issue. |
All issues mentioned here have been fixed except for #6018 which can randomly happen with any native integration tests build. It usually affects 5 to 10 integration tests modules when I run a full Quarkus native build locally. I'll run another full build tonight and check the results tomorrow to make sure nothing got left behind or hidden by #6018. |
We had many successful JDK 11 native tests runs in CI (using GitHub actions like this one). Native image generation and tests with JDK 11 are therefore fully supported now. |
Description
A follow up to #4218 which did the upgrade to GraalVM version 19.3 but focused only on the "JDK8 flavoured edition"
The text was updated successfully, but these errors were encountered: