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

Unable to create AppCDS for PicoCLI CMA #43768

Closed
vladimirfx opened this issue Oct 8, 2024 · 3 comments · Fixed by #43859
Closed

Unable to create AppCDS for PicoCLI CMA #43768

vladimirfx opened this issue Oct 8, 2024 · 3 comments · Fixed by #43859

Comments

@vladimirfx
Copy link

vladimirfx commented Oct 8, 2024

Describe the bug

AppCDS generation is not working for PicoCLI CMA build using Gradle + Jib.

Gradle deps:

dependencies {
    implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}"))
    implementation("io.quarkus:quarkus-picocli")
    implementation("io.quarkus:quarkus-container-image-jib")
    implementation("io.quarkus:quarkus-arc")
    testImplementation("io.quarkus:quarkus-junit5")
}

gradle.properties:

quarkus.container-image.build=true
quarkus.package.jar.appcds.enabled=true

Expected behavior

AppCDS archive is built and used in the resulting container.

Actual behavior

Unable to create AppCDS is print while building.

Relevant debug log part:

2024-10-08T15:16:43.399+0300 [QUIET] [system.out] [0.015s][debug][cds] Total LF lines read from static archive: 154
2024-10-08T15:16:44.237+0300 [QUIET] [system.out] __  ____  __  _____   ___  __ ____  ______ 
2024-10-08T15:16:44.237+0300 [QUIET] [system.out]  --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
2024-10-08T15:16:44.237+0300 [QUIET] [system.out]  -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
2024-10-08T15:16:44.237+0300 [QUIET] [system.out] --\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
2024-10-08T15:16:44.237+0300 [QUIET] [system.out] 2024-10-08 12:16:46,271 WARN  [io.qua.config] (main) Unrecognized configuration key "quarkus.appcds.generate" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2024-10-08T15:16:49.259+0300 [QUIET] [system.out] 2024-10-08 12:16:51,680 ERROR [io.qua.run.Application] (main) Failed to start application: java.lang.IllegalStateException: No CDI container is available
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at io.quarkus.arc.impl.ArcCDIProvider.getCDI(ArcCDIProvider.java:29)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at jakarta.enterprise.inject.spi.CDI.getCDIProvider(CDI.java:77)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at jakarta.enterprise.inject.spi.CDI.current(CDI.java:64)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:122)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at io.quarkus.runner.GeneratedMain.main(Unknown Source)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at java.base/java.lang.reflect.Method.invoke(Method.java:580)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:62)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out]       at io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:33)
2024-10-08T15:16:49.260+0300 [QUIET] [system.out] 
2024-10-08T15:16:49.261+0300 [QUIET] [system.out] 2024-10-08 12:16:51,682 INFO  [io.quarkus] (main) code-with-quarkus stopped in 0.000s

How to Reproduce?

Reproducer: https://github.com/vladimirfx/reproducer-43768

./gradlew assemble

Output of uname -a or ver

No response

Output of java -version

openjdk version "21.0.3" 2024-04-16 LTS

Quarkus version or git rev

3.15.1

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

Gradle 8.9

Additional information

No response

Copy link

quarkus-bot bot commented Oct 8, 2024

/cc @ebullient (picocli), @geoand (jib)

@geoand
Copy link
Contributor

geoand commented Oct 13, 2024

Thanks for reporting.

I'll check this out as soon as I can

@geoand
Copy link
Contributor

geoand commented Oct 14, 2024

#43859 fixes this

geoand added a commit to geoand/quarkus that referenced this issue Oct 14, 2024
@geoand geoand closed this as completed in 93ec6bb Oct 15, 2024
geoand added a commit that referenced this issue Oct 15, 2024
Ensure that AppCDS works properly with command line applications
@quarkus-bot quarkus-bot bot added this to the 3.16 - main milestone Oct 15, 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants