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 generated Feature not being detected after d727a0f9fdb6bc04a7445ed77a217ce4ced2d199 #4736

Closed
zakkak opened this issue Jul 20, 2022 · 8 comments · Fixed by quarkusio/quarkus#26856
Assignees

Comments

@zakkak
Copy link
Collaborator

zakkak commented Jul 20, 2022

Describe the issue

d727a0f introduced a regression in Quarkus Nightly builds.

Steps to reproduce the issue

git clone [email protected]:quarkusio/quarkus.git --depth 1
cd quarkus
./mvnw -Dquickly # This will take some time...
export GRAALVM_HOME=~/path/to/graal/build
./mvnw -Dnative -pl integration-tests/main -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests clean package -Dquarkus.native.container-build=false

Describe GraalVM and your environment:

  • GraalVM version: d727a0f
  • JDK major version: 11
  • OS: Ubuntu Github Runner
  • Architecture: AMD64

More details

The resulting output looks like the following:

[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] /home/zakkak/code/mandrel-packaging/mandrel-bisect/bin/native-image -J-DCoordinatorEnvironmentBean.transactionStatusManagerEnable=false -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true -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-Duser.language=en -J-Duser.country=IE -J-Dfile.encoding=UTF-8 --features=io.quarkus.hibernate.orm.runtime.graal.DisableLoggingFeature,io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature,io.quarkus.jdbc.postgresql.runtime.graal.SQLXMLFeature,io.quarkus.websockets.client.runtime.DisableLoggingFeature,io.quarkus.runner.Feature,io.quarkus.runtime.graal.ResourcesFeature,io.quarkus.runtime.graal.DisableLoggingFeature,io.quarkus.hibernate.validator.runtime.DisableLoggingFeature -H:-ParseOnce -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED -H:ReflectionConfigurationFiles=reflection-config.json -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -J-Djava.awt.headless=true -H:FallbackThreshold=0 --link-at-build-time -H:+ReportExceptionStackTraces -H:+AddAllCharsets -H:EnableURLProtocols=http -H:NativeLinkerOption=-no-pie -H:-UseServiceLoaderFeature -H:+StackTrace -J--add-exports=org.graalvm.sdk/org.graalvm.nativeimage.impl=ALL-UNNAMED -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.proxy=ALL-UNNAMED -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.localization=ALL-UNNAMED -J--add-exports=org.graalvm.nativeimage.base/com.oracle.svm.util=ALL-UNNAMED quarkus-integration-test-main-999-SNAPSHOT-runner -jar quarkus-integration-test-main-999-SNAPSHOT-runner.jar
========================================================================================================================
GraalVM Native Image: Generating 'quarkus-integration-test-main-999-SNAPSHOT-runner' (executable)...
========================================================================================================================
[1/7] Initializing...
                                                                                    (0.0s @ 0.54GB)
Error: Feature io.quarkus.runner.Feature class not found on the classpath. Ensure that the name is correct and that the class is on the classpath.
com.oracle.svm.core.util.UserError$UserException: Feature io.quarkus.runner.Feature class not found on the classpath. Ensure that the name is correct and that the class is on the classpath.
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.UserError.abort(UserError.java:73)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.FeatureHandler.registerFeatures(FeatureHandler.java:135)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.setupNativeImage(NativeImageGenerator.java:847)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:570)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:530)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:403)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:580)
	at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:128)
------------------------------------------------------------------------------------------------------------------------
                        0.5s (4.8% of total time) in 12 GCs | Peak RSS: 1.01GB | CPU load: 3.00
========================================================================================================================
Failed generating 'quarkus-integration-test-main-999-SNAPSHOT-runner' after 10.4s.
Error: Image build request failed with exit status 1

Openning quarkus-integration-test-main-999-SNAPSHOT-runner.jar we see that io.quarkus.runner.Feature is present.

It is also interesting that this class is used by other tests without any issues, e.g.,

./mvnw -Dnative -pl integration-tests/jaxb -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests clean package -Dquarkus.native.container-build=false

Works as expected.

cc @peter-hofer @fniephaus

@zakkak
Copy link
Collaborator Author

zakkak commented Jul 21, 2022

This is a Quarkus issue.

Quarkus tries to access com.oracle.svm.reflect.serialize.hosted.SerializationFeature which has now been moved to com.oracle.svm.hosted.reflect.serialize.SerializationFeature.
https://github.com/quarkusio/quarkus/blob/dee454976827387e088523585968717cc15c82dc/core/deployment/src/main/java/io/quarkus/deployment/steps/NativeImageFeatureStep.java#L591-L592

The reason it only fails with the main integration test is that getRequiredFeatures is not always generated and the issue is triggered only when it does.

@zakkak
Copy link
Collaborator Author

zakkak commented Jul 21, 2022

@christianwimmer I am wondering if the refactoring in 22.3 could be used to make SerializationFeature public API as discussed in #4616?

@christianwimmer
Copy link

@olpaw will work in the next weeks to add proper API for all internals that we find in Quarkus. Existing classes like SerializationFeature themselves cannot be declared public API because they are in the wrong package - all supported API is in the org.graalvm.nativeimage package, so new API that Quarkus can use will be added there.

@fniephaus
Copy link
Member

If you like to help us with this, @zakkak, a complete list of all SVM internals used by Quarkus would be great.

@zakkak
Copy link
Collaborator Author

zakkak commented Jul 30, 2022

Nice. I will be out of office most of August but I believe @galderz will be able to help you with that :)

@galderz
Copy link
Contributor

galderz commented Aug 4, 2022

@fniephaus We're a bit thin at the moment with people off. Didn't @christianwimmer already collect a list of SVM usages in Quarkus? He mentioned having done during the monthly call where we discussed API changes.

As a FYI, following up that call I noted some of the things that seemed relevant to us in quarkusio/quarkus#25943. Issues with serialization were pointed out there too.

@fniephaus
Copy link
Member

That's alright. I believe @olpaw already did scan through Quarkus. He has opened #4783, which is the public API that all frameworks are supposed to rely on soon. So if you could add that to the Quarkus todo list, that would be great. Thanks!

@zakkak
Copy link
Collaborator Author

zakkak commented Sep 27, 2022

Fixed in quarkusio/quarkus#26856

@zakkak zakkak closed this as completed Sep 27, 2022
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.

4 participants