Skip to content

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

Closed
@scrocquesel

Description

@scrocquesel

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions