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

[GraalVM 23.1+] Several quarkus native tests fail with locally installed GraalVM 23.1+ maven artefacts #35872

Closed
jerboaa opened this issue Sep 12, 2023 · 2 comments · Fixed by #35873

Comments

@jerboaa
Copy link
Contributor

jerboaa commented Sep 12, 2023

Describe the bug

Several quarkus IT tests fail when trying to use not-yet-released GraalVM 23.1+ maven artefacts due to the graal-sdk artefact split. Since GraalVM version 23.1 (GraalVM Community for JDK 21), the org.graalvm.sdk:graal-sdk artefact is empty only acting as an umbrella artefact for dep management (so as to provide some form of backwards compatibility). This seems to break certain Quarkus native IT tests, since some of the dependent artefacts, like org.graalvm.sdk:collections, aren't excluded when the source-jar creation is happening. Failures look like this:

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] Running Quarkus native-image plugin on native-image 21-beta 2023-09-19
OpenJDK Runtime Environment Mandrel-23.1.0.0-devc904cd96 (build 21-beta+35-ea)
OpenJDK 64-Bit Server VM Mandrel-23.1.0.0-devc904cd96 (build 21-beta+35-ea, mixed mode)
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] /home/runner/work/mandrel/mandrel/graalvm-home/bin/native-image -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dlogging.initial-configurator.min-level=500 -J-Duser.language=en -J-Duser.country=US -J-Dfile.encoding=UTF-8 --features=io.quarkus.hibernate.orm.runtime.graal.DisableLoggingFeature,io.quarkus.runner.Feature,io.quarkus.runtime.graal.DisableLoggingFeature,io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature,org.hibernate.graalvm.internal.GraalVMStaticFeature,io.quarkus.jdbc.h2.runtime.H2Reflections -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -J--add-opens=java.base/java.io=ALL-UNNAMED -J--add-opens=java.base/java.lang.invoke=ALL-UNNAMED -J--add-opens=java.base/java.util=ALL-UNNAMED -H:+UnlockExperimentalVMOptions -H:BuildOutputJSONFile=quarkus-integration-test-hibernate-orm-panache-kotlin-999-SNAPSHOT-runner-build-output-stats.json -H:-UnlockExperimentalVMOptions -H:+UnlockExperimentalVMOptions -H:+AllowFoldMethods -H:-UnlockExperimentalVMOptions -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+UnlockExperimentalVMOptions -H:+ReportExceptionStackTraces -H:-UnlockExperimentalVMOptions -J-Xmx5g -H:-AddAllCharsets --enable-url-protocols=http,https -H:NativeLinkerOption=-no-pie -H:+UnlockExperimentalVMOptions -H:-UseServiceLoaderFeature -H:-UnlockExperimentalVMOptions -J--add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED --add-modules=jdk.net --exclude-config io\.netty\.netty-codec /META-INF/native-image/io\.netty/netty-codec/generated/handlers/reflect-config\.json --exclude-config io\.netty\.netty-handler /META-INF/native-image/io\.netty/netty-handler/generated/handlers/reflect-config\.json quarkus-integration-test-hibernate-orm-panache-kotlin-999-SNAPSHOT-runner -jar quarkus-integration-test-hibernate-orm-panache-kotlin-999-SNAPSHOT-runner.jar
Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.netty/netty-transport/reflection-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
Error: Class-path entry file:///home/runner/work/mandrel/mandrel/quarkus/integration-tests/hibernate-orm-panache-kotlin/target/quarkus-integration-test-hibernate-orm-panache-kotlin-999-SNAPSHOT-native-image-source-jar/lib/org.graalvm.sdk.collections-23.1.0.0.SNAPSHOT.jar contains class org.graalvm.collections.EconomicMapWrap. This class is part of the image builder itself (in file:///home/runner/work/mandrel/mandrel/graalvm-home/lib/jvmci/collections.jar) and must not be passed via -cp. This can be caused by a fat-jar that illegally includes svm.jar (or graal-sdk.jar) due to its build-time dependency on it. As a workaround, -H:+AllowDeprecatedBuilderClassesOnImageClasspath allows turning this error into a warning. Note that this option is deprecated and will be removed in a future version.
com.oracle.svm.core.util.UserError$UserException: Class-path entry file:///home/runner/work/mandrel/mandrel/quarkus/integration-tests/hibernate-orm-panache-kotlin/target/quarkus-integration-test-hibernate-orm-panache-kotlin-999-SNAPSHOT-native-image-source-jar/lib/org.graalvm.sdk.collections-23.1.0.0.SNAPSHOT.jar contains class org.graalvm.collections.EconomicMapWrap. This class is part of the image builder itself (in file:///home/runner/work/mandrel/mandrel/graalvm-home/lib/jvmci/collections.jar) and must not be passed via -cp. This can be caused by a fat-jar that illegally includes svm.jar (or graal-sdk.jar) due to its build-time dependency on it. As a workaround, -H:+AllowDeprecatedBuilderClassesOnImageClasspath allows turning this error into a warning. Note that this option is deprecated and will be removed in a future version.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:73)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoaderSupport.reportBuilderClassesInApplication(NativeImageClassLoaderSupport.java:907)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.ImageClassLoader.loadAllClasses(ImageClassLoader.java:105)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:385)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:711)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:142)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:97)

See for example here:
https://github.com/jerboaa/graal/actions/runs/6146546436/job/16682584476#step:12:154

It seems the following native IT tests are affected:

  • Hibernate ORM with Panache and Kotlin
  • OpenID Connect Adapter
  • Security WebAuthn
  • Integration Tests - SmallRye GraphQL
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 12, 2023

/cc @Karm (mandrel), @evanchooly (kotlin), @galderz (mandrel), @geoand (kotlin), @quarkusio/devtools (maven), @zakkak (mandrel)

@jerboaa
Copy link
Contributor Author

jerboaa commented Sep 12, 2023

Related: #28650

I think @zakkak is looking into it.

@zakkak zakkak self-assigned this Sep 12, 2023
zakkak added a commit to zakkak/quarkus that referenced this issue Sep 12, 2023
oracle/graal#7171 splits graal-sdk in 4 new
modules/artifacts. As a result starting with GraalVM for JDK 21 (23.1)
we need to remove those as well. Note that it's OK to have them marked
for removal even when using GraalVM < 23.1 despite them not actually
being present.

Closes quarkusio#35872
zakkak added a commit to zakkak/quarkus that referenced this issue Sep 12, 2023
oracle/graal#7171 splits graal-sdk in 4 new
modules/artifacts. As a result starting with GraalVM for JDK 21 (23.1)
we need to remove those as well. Note that it's OK to have them marked
for removal even when using GraalVM < 23.1 despite them not actually
being present.

Closes quarkusio#35872
zakkak added a commit to zakkak/quarkus that referenced this issue Sep 12, 2023
oracle/graal#7171 splits graal-sdk in 4 new
modules/artifacts. As a result starting with GraalVM for JDK 21 (23.1)
we need to remove those as well. Note that it's OK to have them marked
for removal even when using GraalVM < 23.1 despite them not actually
being present.

Closes quarkusio#35872
@quarkus-bot quarkus-bot bot added this to the 3.5 - main milestone Sep 13, 2023
franz1981 pushed a commit to franz1981/quarkus that referenced this issue Sep 13, 2023
oracle/graal#7171 splits graal-sdk in 4 new
modules/artifacts. As a result starting with GraalVM for JDK 21 (23.1)
we need to remove those as well. Note that it's OK to have them marked
for removal even when using GraalVM < 23.1 despite them not actually
being present.

Closes quarkusio#35872
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Feb 8, 2024
oracle/graal#7171 splits graal-sdk in 4 new
modules/artifacts. As a result starting with GraalVM for JDK 21 (23.1)
we need to remove those as well. Note that it's OK to have them marked
for removal even when using GraalVM < 23.1 despite them not actually
being present.

Closes quarkusio#35872
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants