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 fails to get GraalVM version from GraalVM CE builds based on OpenJDK instead of LabsJDK #42893

Closed
zakkak opened this issue Aug 30, 2024 · 3 comments · Fixed by #43716
Closed
Labels
area/native-image kind/bug Something isn't working
Milestone

Comments

@zakkak
Copy link
Contributor

zakkak commented Aug 30, 2024

Describe the bug

Using a GraalVM build based on OpenJDK instead of LabsJDK results in build failures of native executables.

Expected behavior

The build should succeed if it succeeds with a LabsJDK based build of GraalVM.

Actual behavior

The build fails with:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:999-SNAPSHOT:build (default) on project quarkus-integration-test-picocli-native: Failed to build quarkus application: io.quarkus.builder.BuildException: 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 get GraalVM version
[ERROR] 	at io.quarkus.deployment.pkg.steps.NativeImageBuildRunner.getGraalVMVersion(NativeImageBuildRunner.java:41)
[ERROR] 	at io.quarkus.deployment.pkg.steps.NativeImageBuildStep.build(NativeImageBuildStep.java:236)
[ERROR] 	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:733)
[ERROR] 	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:854)
[ERROR] 	at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
[ERROR] 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
[ERROR] 	at java.base/java.lang.Thread.run(Thread.java:1583)
[ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:483)
[ERROR] Caused by: java.lang.NumberFormatException: For input string: "null"
[ERROR] 	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
[ERROR] 	at java.base/java.lang.Integer.parseInt(Integer.java:662)
[ERROR] 	at java.base/java.lang.Integer.parseInt(Integer.java:778)
[ERROR] 	at java.base/java.util.stream.ReferencePipeline$4$1.accept(ReferencePipeline.java:214)
[ERROR] 	at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024)
[ERROR] 	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
[ERROR] 	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
[ERROR] 	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
[ERROR] 	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
[ERROR] 	at java.base/java.util.stream.IntPipeline.toArray(IntPipeline.java:562)
[ERROR] 	at io.quarkus.deployment.pkg.steps.GraalVM$Version.breakdownVersion(GraalVM.java:240)
[ERROR] 	at io.quarkus.deployment.pkg.steps.GraalVM$Version.<init>(GraalVM.java:229)
[ERROR] 	at io.quarkus.deployment.pkg.steps.GraalVM$VersionParseHelper.parse(GraalVM.java:89)
[ERROR] 	at io.quarkus.deployment.pkg.steps.GraalVM$Version.of(GraalVM.java:306)
[ERROR] 	at io.quarkus.deployment.pkg.steps.NativeImageBuildRunner.getGraalVMVersion(NativeImageBuildRunner.java:38)
[ERROR] 	... 10 more

How to Reproduce?

  1. Build GraalVM from source using OpenJDK as the base JDK (or grab a build from the artifacts of https://github.com/graalvm/graalvm-community-jdk21u/actions/workflows/quarkus.yml)
  2. Set GRAALVM_HOME to point to the freshly built GraalVM
  3. Try to generate a native executable

Output of uname -a or ver

No response

Output of java -version

No response

Mandrel or GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

This is happening because Quarkus currently has not way to infer the GraalVM version from the --version output, and fails to handle the failure as well.

The --version output that can't be processed by Quarkus is:

native-image 21.0.5-beta 2024-10-15
GraalVM Runtime Environment GraalVM CE 21.0.5-dev.beta+4.1 (build 21.0.5-beta+4-ea)
Substrate VM GraalVM CE 21.0.5-dev.beta+4.1 (build 21.0.5-beta+4-ea, serial gc)
@zakkak zakkak added kind/bug Something isn't working area/native-image labels Aug 30, 2024
Copy link

quarkus-bot bot commented Aug 30, 2024

/cc @Karm (mandrel), @galderz (mandrel)

@galderz
Copy link
Member

galderz commented Sep 6, 2024

Maybe it needs to deal with a beta build prefix? Maybe a solution like the one for #42516 is needed?

@zakkak
Copy link
Contributor Author

zakkak commented Sep 9, 2024

Yes, we need to properly identify the version pattern and then map the JDK version to the GraalVM "internal" version (at least till they get in sync with the 25 release).

zakkak added a commit to zakkak/quarkus that referenced this issue Oct 4, 2024
zakkak added a commit to zakkak/quarkus that referenced this issue Oct 7, 2024
@zakkak zakkak closed this as completed in 55751ae Oct 10, 2024
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Oct 10, 2024
bschuhmann pushed a commit to bschuhmann/quarkus that referenced this issue Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants