Skip to content

[Native Image] Some .so libs are not considered Produced artifacts #11241

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

Open
1 task
scrocquesel opened this issue May 21, 2025 · 2 comments
Open
1 task

[Native Image] Some .so libs are not considered Produced artifacts #11241

scrocquesel opened this issue May 21, 2025 · 2 comments
Assignees

Comments

@scrocquesel
Copy link

Describe the Issue

I'm compiling a Quarkus application using AWS CRT package. This package relies on a native library which is embeded in the package.

The lib is extracted to the native image path by a GraalVM Feature after image write but is not considered as a build artifact and is not in the output of -H:+GenerateBuildArtifactsFile.

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

Java version: 21.0.7+6-LTS, vendor version: Mandrel-23.1.7.0-Final

Operating System and Version

Linux

Build Command

-J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Duser.language=fr -J-Duser.country=FR -J-Dlogging.initial-configurator.min-level=500 -H:+UnlockExperimentalVMOptions -H:IncludeLocales=fr-FR -H:-UnlockExperimentalVMOptions -J-Dfile.encoding=UTF-8 -J--add-exports=org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk=ALL-UNNAMED --features=io.quarkus.runner.Feature,io.quarkus.runtime.graal.DisableLoggingFeature,io.quarkus.runtime.graal.SkipConsoleServiceProvidersFeature -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-exports=java.security.jgss/sun.security.jgss=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-aws-sso-native-0.0.0-SNAPSHOT-runner-build-output-stats.json -H:-UnlockExperimentalVMOptions -H:+UnlockExperimentalVMOptions -H:+GenerateBuildArtifactsFile -H:-UnlockExperimentalVMOptions --strict-image-heap -H:+UnlockExperimentalVMOptions -H:+AllowFoldMethods -H:-UnlockExperimentalVMOptions -J-Djava.awt.headless=true --no-fallback --link-at-build-time -H:+UnlockExperimentalVMOptions -H:+ReportExceptionStackTraces -H:-UnlockExperimentalVMOptions -H:-AddAllCharsets --enable-url-protocols=http,https --enable-monitoring=heapdump -H:+UnlockExperimentalVMOptions -H:-UseServiceLoaderFeature -H:-UnlockExperimentalVMOptions -J--add-exports=org.graalvm.nativeimage/org.graalvm.nativeimage.impl=ALL-UNNAMED quarkus-aws-sso-native-0.0.0-SNAPSHOT-runner -jar quarkus-aws-sso-native-0.0.0-SNAPSHOT-runner.jar

Expected Behavior

Produced artifacts should list libaws-crt-jni.so because it is used by the application and exists in the native image target folder like it does when using jdk lib like libawt.so for example.

Actual Behavior

Produced artifacts:
 /project/build-artifacts.json (build_info)
 /project/quarkus-aws-sso-native-0.0.0-SNAPSHOT-runner (executable)
 /project/quarkus-aws-sso-native-0.0.0-SNAPSHOT-runner-build-output-stats.json (build_info)

Steps to Reproduce

  1. Add dependency

    <dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>aws-crt-client</artifactId>
        <version>0.38.2</version>
    </dependency>
    
  2. Make a call to init CRT and import the lib

    new software.amazon.awssdk.crt.CRT();
    

Additional Context

Build Log Output and Error Messages

No response

@selhagani
Copy link
Member

Hi @scrocquesel,

Thank you for reaching out to us about this.
Could you please create a minimal reproducer alongside the steps needed to encounter the issue using a Github repository?

@scrocquesel
Copy link
Author

Hello, here it is https://github.com/scrocquesel/quarkus-amazon-services-crt-client-issue

The output will show

Produced artifacts:
 /project/build-artifacts.json (build_info)
 /project/quarkus-amazon-services-crt-client-issue-1.0.0-SNAPSHOT-runner (executable)
 /project/quarkus-amazon-services-crt-client-issue-1.0.0-SNAPSHOT-runner-build-output-stats.json (build_info)

and build-artifacts.json

{"build_info":["quarkus-amazon-services-crt-client-issue-1.0.0-SNAPSHOT-runner-build-output-stats.json"],"executables":["quarkus-amazon-services-crt-client-issue-1.0.0-SNAPSHOT-runner"]}

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

No branches or pull requests

2 participants