quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.74k stars 2.67k forks source link

Add property to disable link-at-build-time at graalvm version 22.1 native-image build (Since Quarkus version 2.8) #25526

Closed knuspertante closed 6 months ago

knuspertante commented 2 years ago

Description

Hey,

since Quarkus Version 2.8 - GraalVM 22.1 is used and therefore link-at-build-time is added as default parameter. (See: https://github.com/quarkusio/quarkus/pull/24213)

But currently I don't know any way to disable or remove this parameter.

Implementation ideas

No response

zakkak commented 2 years ago

Hello @knuspertante,

This is something that Quarkus wouldn't want to encourage. Could you please explain why that option is important to your use case?

One way to disable the --link-at-build-time flag is by creating a NativeImageAllowIncompleteClasspathBuildItem as in https://github.com/quarkusio/quarkus/blob/3f9bf7ba99c15032ba9c46c83d5f5f2579bca612/extensions/jdbc/jdbc-oracle/deployment/src/main/java/io/quarkus/jdbc/oracle/deployment/OracleMetadataOverrides.java#L114-L117

knuspertante commented 2 years ago

Hi @zakkak,

thx for the fast reply.

When I want to build a native-image with --link-at-build-time I got the following error.

Error: Unsupported features in 3 methods
Detailed message:
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: net.sf.oval.expression.ExpressionLanguageJavaScriptImpl.<init>(). This error is reported at image build time because class net.sf.oval.expression.ExpressionLanguageRegistry is registered for linking at image build time by command line
Trace: 
        at parsing net.sf.oval.expression.ExpressionLanguageRegistry._initializeDefaultEL(ExpressionLanguageRegistry.java:26)
Call path from entry point to net.sf.oval.expression.ExpressionLanguageRegistry._initializeDefaultEL(String): 
        at net.sf.oval.expression.ExpressionLanguageRegistry._initializeDefaultEL(ExpressionLanguageRegistry.java:25)
        at net.sf.oval.expression.ExpressionLanguageRegistry.getExpressionLanguage(ExpressionLanguageRegistry.java:73)
        at net.sf.oval.AbstractCheck.isActive(AbstractCheck.java:154)
        at net.sf.oval.Validator.checkConstraint(Validator.java:791)
        at net.sf.oval.Validator.lambda$1(Validator.java:894)
        at net.sf.oval.Validator$$Lambda$4105/0x0000000104b96bd0.accept(Unknown Source)
        at java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
        at software.amazon.awssdk.protocols.jsoncore.internal.ObjectJsonNode.toString(ObjectJsonNode.java:94)
        at sun.java2d.loops.GraphicsPrimitive.simplename(GraphicsPrimitive.java:610)
        at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_ARRAY_GraphicsPrimitive_simplename_202a3eedb200439fc8661f318bfce7d323ea7603(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: net.sf.oval.ogn.ObjectGraphNavigatorJXPathImpl.<init>(). This error is reported at image build time because class net.sf.oval.ogn.ObjectGraphNavigatorRegistry is registered for linking at image build time by command line
Trace: 
        at parsing net.sf.oval.ogn.ObjectGraphNavigatorRegistry._initializeDefaultOGN(ObjectGraphNavigatorRegistry.java:26)
Call path from entry point to net.sf.oval.ogn.ObjectGraphNavigatorRegistry._initializeDefaultOGN(String): 
        at net.sf.oval.ogn.ObjectGraphNavigatorRegistry._initializeDefaultOGN(ObjectGraphNavigatorRegistry.java:25)
        at net.sf.oval.ogn.ObjectGraphNavigatorRegistry.getObjectGraphNavigator(ObjectGraphNavigatorRegistry.java:39)
        at net.sf.oval.Validator.checkConstraint(Validator.java:816)
        at net.sf.oval.Validator.lambda$1(Validator.java:894)
        at net.sf.oval.Validator$$Lambda$4105/0x0000000104b96bd0.accept(Unknown Source)
        at java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
        at software.amazon.awssdk.protocols.jsoncore.internal.ObjectJsonNode.toString(ObjectJsonNode.java:94)
        at sun.java2d.loops.GraphicsPrimitive.simplename(GraphicsPrimitive.java:610)
        at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_ARRAY_GraphicsPrimitive_simplename_202a3eedb200439fc8661f318bfce7d323ea7603(generated:0)
Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: ucar.nc2.grib.grib2.Grib2JpegDecoder.<init>(int, boolean). This error is reported at image build time because class ucar.nc2.grib.grib2.Grib2DataReader2 is registered for linking at image build time by command line
Trace: 
        at parsing ucar.nc2.grib.grib2.Grib2DataReader2.getData40(Grib2DataReader2.java:727)
Call path from entry point to ucar.nc2.grib.grib2.Grib2DataReader2.getData40(RandomAccessFile, Grib2Drs$Type40): 
        at ucar.nc2.grib.grib2.Grib2DataReader2.getData40(Grib2DataReader2.java:716)
        at ucar.nc2.grib.grib2.Grib2DataReader2.getData(Grib2DataReader2.java:109)
        at ucar.nc2.grib.grib2.Grib2Record.readData(Grib2Record.java:321)
        at ucar.nc2.grib.collection.Grib2Iosp.readData(Grib2Iosp.java:405)
        at ucar.nc2.grib.collection.GribIosp$DataReader.read(GribIosp.java:940)
        at ucar.nc2.grib.collection.GribIosp.readDataFromCollection(GribIosp.java:860)
        at ucar.nc2.grib.collection.GribIosp.readData(GribIosp.java:810)
        at ucar.nc2.NetcdfFile.readData(NetcdfFile.java:1986)
        at ucar.nc2.Variable.reallyRead(Variable.java:860)
        at ucar.nc2.Variable._read(Variable.java:831)
        at ucar.nc2.Variable.read(Variable.java:709)
        at ucar.nc2.NCdumpW.printVariableData(NCdumpW.java:386)
        at ucar.nc2.dt.grid.GridCoordSys.showCoords(GridCoordSys.java:1405)
        at ucar.nc2.dt.grid.GridCoordSys.show(GridCoordSys.java:1355)
        at ucar.nc2.dt.grid.GridCoordSys.toString(GridCoordSys.java:1345)
        at sun.java2d.loops.GraphicsPrimitive.simplename(GraphicsPrimitive.java:610)
        at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_ARRAY_GraphicsPrimitive_simplename_202a3eedb200439fc8661f318bfce7d323ea7603(generated:0)

With the following code, I only can provide a quarkus extension or?

new NativeImageAllowIncompleteClasspathBuildItem("quarkus-jdbc-oracle"); 

Do you have another idea how I can solve my problem?

zakkak commented 2 years ago

This looks like a classpath issue that you should not "work around".

The error essentially says that GraalVM fails to find 2 constructors from net.sf.oval:oval (while loading other methods just fine), and 1 constructor from ucar.nc2:grib (while loading other methods just fine). This behavior makes me think that either:

  1. there is something wrong with the classpath
  2. or there is a GraalVM bug you are hitting.

To further help with this issue could you please try compiling your application with a different GraalVM version? e.g. 22.0 but without using --allow-incomplete-classpath.

Is there any chance you could share your reproducer? If not, could you least the maven/gradle part where you define the oval and grib dependencies?

knuspertante commented 2 years ago

To further help with this issue could you please try compiling your application with a different GraalVM version? e.g. 22.0 but without using --allow-incomplete-classpath.

This works just fine.

I will try to generate a reproducer.

Until that here is the output of mvn dependency:tree...

[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------< de.j21p:janus-funqy-functions-quarkus >----------------
[INFO] Building janus-funqy-functions-quarkus 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ janus-funqy-functions-quarkus ---
[INFO] de.j21p:janus-funqy-functions-quarkus:jar:1.0.0-SNAPSHOT
[INFO] +- io.quarkus:quarkus-funqy-amazon-lambda:jar:2.9.0.Final:compile
[INFO] |  +- io.quarkus:quarkus-amazon-lambda-common:jar:2.9.0.Final:compile
[INFO] |  |  +- com.amazonaws:aws-lambda-java-core:jar:1.2.1:compile
[INFO] |  |  +- com.amazonaws:aws-lambda-java-events:jar:3.11.0:compile
[INFO] |  |  \- com.fasterxml.jackson.datatype:jackson-datatype-joda:jar:2.13.2:compile
[INFO] |  |     +- com.fasterxml.jackson.core:jackson-core:jar:2.13.2:compile
[INFO] |  |     \- joda-time:joda-time:jar:2.10.8:compile
[INFO] |  +- io.quarkus:quarkus-funqy-server-common:jar:2.9.0.Final:compile
[INFO] |  |  \- io.smallrye.reactive:mutiny:jar:1.4.0:compile
[INFO] |  |     +- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] |  |     \- io.smallrye.common:smallrye-common-annotation:jar:1.11.0:compile
[INFO] |  \- io.quarkus:quarkus-jackson:jar:2.9.0.Final:compile
[INFO] |     +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.2:compile
[INFO] |     +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.13.2:compile
[INFO] |     +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.13.2:compile
[INFO] |     \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.13.2:compile
[INFO] +- io.quarkus:quarkus-arc:jar:2.9.0.Final:compile
[INFO] |  +- io.quarkus.arc:arc:jar:2.9.0.Final:compile
[INFO] |  |  +- jakarta.enterprise:jakarta.enterprise.cdi-api:jar:2.0.2:compile
[INFO] |  |  |  +- jakarta.el:jakarta.el-api:jar:3.0.3:compile
[INFO] |  |  |  \- jakarta.interceptor:jakarta.interceptor-api:jar:1.2.5:compile
[INFO] |  |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  |  +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] |  |  \- org.jboss.logging:jboss-logging:jar:3.4.3.Final:compile
[INFO] |  +- io.quarkus:quarkus-core:jar:2.9.0.Final:compile
[INFO] |  |  +- jakarta.inject:jakarta.inject-api:jar:1.0:compile
[INFO] |  |  +- io.quarkus:quarkus-ide-launcher:jar:2.9.0.Final:compile
[INFO] |  |  +- io.quarkus:quarkus-development-mode-spi:jar:2.9.0.Final:compile
[INFO] |  |  +- io.smallrye.config:smallrye-config:jar:2.10.0:compile
[INFO] |  |  |  \- io.smallrye.config:smallrye-config-core:jar:2.10.0:compile
[INFO] |  |  |     +- org.eclipse.microprofile.config:microprofile-config-api:jar:2.0.1:compile
[INFO] |  |  |     +- io.smallrye.common:smallrye-common-expression:jar:1.11.0:compile
[INFO] |  |  |     |  \- io.smallrye.common:smallrye-common-function:jar:1.11.0:compile
[INFO] |  |  |     +- io.smallrye.common:smallrye-common-constraint:jar:1.11.0:compile
[INFO] |  |  |     +- io.smallrye.common:smallrye-common-classloader:jar:1.11.0:compile
[INFO] |  |  |     \- io.smallrye.config:smallrye-config-common:jar:2.10.0:compile
[INFO] |  |  +- org.jboss.logmanager:jboss-logmanager-embedded:jar:1.0.9:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging-annotations:jar:2.2.1.Final:compile
[INFO] |  |  +- org.jboss.threads:jboss-threads:jar:3.4.2.Final:compile
[INFO] |  |  +- org.slf4j:slf4j-api:jar:1.7.36:compile
[INFO] |  |  +- org.jboss.slf4j:slf4j-jboss-logmanager:jar:1.1.0.Final:compile
[INFO] |  |  +- org.graalvm.sdk:graal-sdk:jar:22.0.0.2:compile
[INFO] |  |  +- org.wildfly.common:wildfly-common:jar:1.5.4.Final-format-001:compile
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-runner:jar:2.9.0.Final:compile
[INFO] |  |  \- io.quarkus:quarkus-fs-util:jar:0.0.9:compile
[INFO] |  \- org.eclipse.microprofile.context-propagation:microprofile-context-propagation-api:jar:1.2:compile
[INFO] +- de.j21p:janus-services-quarkus:jar:1.0.0-SNAPSHOT:compile
[INFO] |  +- io.quarkiverse.amazonservices:quarkus-amazon-ssm:jar:1.1.1:compile
[INFO] |  |  +- io.quarkus:quarkus-netty:jar:2.9.0.Final:compile
[INFO] |  |  |  +- io.netty:netty-codec:jar:4.1.74.Final:compile
[INFO] |  |  |  |  +- io.netty:netty-common:jar:4.1.74.Final:compile
[INFO] |  |  |  |  +- io.netty:netty-buffer:jar:4.1.74.Final:compile
[INFO] |  |  |  |  \- io.netty:netty-transport:jar:4.1.74.Final:compile
[INFO] |  |  |  +- io.netty:netty-codec-http:jar:4.1.74.Final:compile
[INFO] |  |  |  +- io.netty:netty-codec-http2:jar:4.1.74.Final:compile
[INFO] |  |  |  \- io.netty:netty-handler:jar:4.1.74.Final:compile
[INFO] |  |  |     +- io.netty:netty-resolver:jar:4.1.74.Final:compile
[INFO] |  |  |     \- io.netty:netty-tcnative-classes:jar:2.0.48.Final:compile
[INFO] |  |  +- io.quarkiverse.amazonservices:quarkus-amazon-common:jar:1.1.1:compile
[INFO] |  |  |  +- software.amazon.awssdk:sdk-core:jar:2.17.166:compile
[INFO] |  |  |  +- software.amazon.awssdk:aws-core:jar:2.17.166:compile
[INFO] |  |  |  |  \- software.amazon.eventstream:eventstream:jar:1.0.1:compile
[INFO] |  |  |  +- software.amazon.awssdk:regions:jar:2.17.166:compile
[INFO] |  |  |  |  \- software.amazon.awssdk:json-utils:jar:2.17.166:compile
[INFO] |  |  |  \- software.amazon.awssdk:auth:jar:2.17.166:compile
[INFO] |  |  \- software.amazon.awssdk:ssm:jar:2.17.166:compile
[INFO] |  |     +- software.amazon.awssdk:aws-json-protocol:jar:2.17.166:compile
[INFO] |  |     |  \- software.amazon.awssdk:third-party-jackson-core:jar:2.17.166:compile
[INFO] |  |     +- software.amazon.awssdk:protocol-core:jar:2.17.166:compile
[INFO] |  |     \- software.amazon.awssdk:metrics-spi:jar:2.17.166:compile
[INFO] |  +- software.amazon.awssdk:url-connection-client:jar:2.17.166:compile
[INFO] |  |  +- software.amazon.awssdk:utils:jar:2.17.166:compile
[INFO] |  |  +- software.amazon.awssdk:annotations:jar:2.17.166:compile
[INFO] |  |  \- software.amazon.awssdk:http-client-spi:jar:2.17.166:compile
[INFO] |  +- io.quarkiverse.amazonservices:quarkus-amazon-dynamodb:jar:1.1.1:compile
[INFO] |  |  \- software.amazon.awssdk:dynamodb:jar:2.17.166:compile
[INFO] |  |     \- software.amazon.awssdk:profiles:jar:2.17.166:compile
[INFO] |  +- org.jboss.logmanager:log4j2-jboss-logmanager:jar:1.1.1.Final:compile
[INFO] |  |  \- org.apache.logging.log4j:log4j-api:jar:2.17.2:compile
[INFO] |  +- org.jboss.logmanager:log4j-jboss-logmanager:jar:1.3.0.Final:compile
[INFO] |  +- org.jboss.logging:commons-logging-jboss-logging:jar:1.0.0.Final:compile
[INFO] |  +- io.quarkiverse.tika:quarkus-tika:jar:1.0.3:compile
[INFO] |  |  +- io.quarkus:quarkus-apache-httpclient:jar:2.9.0.Final:compile
[INFO] |  |  +- org.apache.tika:tika-parsers:jar:1.27:compile
[INFO] |  |  |  +- org.apache.tika:tika-core:jar:1.27:compile
[INFO] |  |  |  +- com.fasterxml.woodstox:woodstox-core:jar:6.2.6:compile
[INFO] |  |  |  |  \- org.codehaus.woodstox:stax2-api:jar:4.2.1:compile
[INFO] |  |  |  +- org.gagravarr:vorbis-java-tika:jar:0.8:compile
[INFO] |  |  |  +- org.tallison:jmatio:jar:1.5:compile
[INFO] |  |  |  +- org.apache.james:apache-mime4j-core:jar:0.8.4:compile
[INFO] |  |  |  +- org.apache.james:apache-mime4j-dom:jar:0.8.4:compile
[INFO] |  |  |  +- com.googlecode.plist:dd-plist:jar:1.23:compile
[INFO] |  |  |  +- org.apache.commons:commons-compress:jar:1.21:compile
[INFO] |  |  |  +- org.tukaani:xz:jar:1.9:compile
[INFO] |  |  |  +- com.epam:parso:jar:2.0.14:compile
[INFO] |  |  |  +- org.brotli:dec:jar:0.1.2:compile
[INFO] |  |  |  +- org.apache.pdfbox:pdfbox:jar:2.0.24:compile
[INFO] |  |  |  |  \- org.apache.pdfbox:fontbox:jar:2.0.24:compile
[INFO] |  |  |  +- org.apache.pdfbox:pdfbox-tools:jar:2.0.24:compile
[INFO] |  |  |  +- org.apache.pdfbox:preflight:jar:2.0.24:compile
[INFO] |  |  |  +- org.apache.pdfbox:jempbox:jar:1.8.16:compile
[INFO] |  |  |  +- org.apache.pdfbox:xmpbox:jar:2.0.24:compile
[INFO] |  |  |  +- org.bouncycastle:bcmail-jdk15on:jar:1.69:compile
[INFO] |  |  |  |  +- org.bouncycastle:bcutil-jdk15on:jar:1.69:compile
[INFO] |  |  |  |  \- org.bouncycastle:bcpkix-jdk15on:jar:1.70:compile
[INFO] |  |  |  +- org.bouncycastle:bcprov-jdk15on:jar:1.70:compile
[INFO] |  |  |  +- org.apache.poi:poi:jar:4.1.2:compile
[INFO] |  |  |  |  +- org.apache.commons:commons-collections4:jar:4.4:compile
[INFO] |  |  |  |  +- org.apache.commons:commons-math3:jar:3.6.1:compile
[INFO] |  |  |  |  \- com.zaxxer:SparseBitSet:jar:1.2:compile
[INFO] |  |  |  +- org.apache.poi:poi-scratchpad:jar:4.1.2:compile
[INFO] |  |  |  +- org.apache.poi:poi-ooxml:jar:4.1.2:compile
[INFO] |  |  |  |  +- org.apache.poi:poi-ooxml-schemas:jar:4.1.2:compile
[INFO] |  |  |  |  |  \- org.apache.xmlbeans:xmlbeans:jar:3.1.0:compile
[INFO] |  |  |  |  \- com.github.virtuald:curvesapi:jar:1.06:compile
[INFO] |  |  |  +- com.healthmarketscience.jackcess:jackcess:jar:4.0.1:compile
[INFO] |  |  |  +- com.healthmarketscience.jackcess:jackcess-encrypt:jar:4.0.1:compile
[INFO] |  |  |  +- org.ow2.asm:asm:jar:9.3:compile
[INFO] |  |  |  +- org.tallison:isoparser:jar:1.9.41.7:compile
[INFO] |  |  |  +- org.tallison:metadata-extractor:jar:2.15.0.1:compile
[INFO] |  |  |  |  \- org.tallison.xmp:xmpcore-shaded:jar:6.1.11:compile
[INFO] |  |  |  +- de.l3s.boilerpipe:boilerpipe:jar:1.1.0:compile
[INFO] |  |  |  +- com.rometools:rome:jar:1.15.0:compile
[INFO] |  |  |  |  \- com.rometools:rome-utils:jar:1.15.0:compile
[INFO] |  |  |  +- org.gagravarr:vorbis-java-core:jar:0.8:compile
[INFO] |  |  |  +- com.googlecode.juniversalchardet:juniversalchardet:jar:1.0.3:compile
[INFO] |  |  |  +- org.codelibs:jhighlight:jar:1.0.3:compile
[INFO] |  |  |  +- com.pff:java-libpst:jar:0.9.3:compile
[INFO] |  |  |  +- com.github.junrar:junrar:jar:7.4.0:compile
[INFO] |  |  |  +- org.glassfish.jaxb:jaxb-runtime:jar:2.3.3-b02:compile
[INFO] |  |  |  |  +- org.glassfish.jaxb:txw2:jar:2.3.3-b02:compile
[INFO] |  |  |  |  +- com.sun.istack:istack-commons-runtime:jar:3.0.10:compile
[INFO] |  |  |  |  \- com.sun.activation:jakarta.activation:jar:1.2.1:runtime
[INFO] |  |  |  +- org.apache.commons:commons-exec:jar:1.3:compile
[INFO] |  |  |  +- org.apache.opennlp:opennlp-tools:jar:1.9.3:compile
[INFO] |  |  |  +- commons-io:commons-io:jar:2.11.0:compile
[INFO] |  |  |  +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] |  |  |  +- com.github.openjson:openjson:jar:1.0.12:compile
[INFO] |  |  |  +- com.google.code.gson:gson:jar:2.9.0:compile
[INFO] |  |  |  +- org.slf4j:jul-to-slf4j:jar:1.7.30:compile
[INFO] |  |  |  +- edu.ucar:netcdf4:jar:4.5.5:compile
[INFO] |  |  |  +- org.jdom:jdom2:jar:2.0.6:compile
[INFO] |  |  |  +- com.google.guava:guava:jar:31.1-jre:compile
[INFO] |  |  |  |  +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  |  |  |  +- com.google.errorprone:error_prone_annotations:jar:2.13.1:compile
[INFO] |  |  |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  |  |  +- edu.ucar:grib:jar:4.5.5:compile
[INFO] |  |  |  |  \- org.itadaki:bzip2:jar:0.9.1:compile
[INFO] |  |  |  +- net.jcip:jcip-annotations:jar:1.0:compile
[INFO] |  |  |  +- com.beust:jcommander:jar:1.81:compile
[INFO] |  |  |  +- net.java.dev.jna:jna:jar:5.8.0:compile
[INFO] |  |  |  +- org.jsoup:jsoup:jar:1.14.2:compile
[INFO] |  |  |  +- com.google.protobuf:protobuf-java:jar:3.19.3:compile
[INFO] |  |  |  +- edu.ucar:cdm:jar:4.5.5:compile
[INFO] |  |  |  |  +- edu.ucar:udunits:jar:4.5.5:compile
[INFO] |  |  |  |  \- net.sf.ehcache:ehcache-core:jar:2.6.2:compile
[INFO] |  |  |  +- org.quartz-scheduler:quartz:jar:2.3.2:compile
[INFO] |  |  |  |  \- com.zaxxer:HikariCP-java7:jar:2.4.13:compile
[INFO] |  |  |  +- com.mchange:c3p0:jar:0.9.5.5:compile
[INFO] |  |  |  |  \- com.mchange:mchange-commons-java:jar:0.2.19:compile
[INFO] |  |  |  +- edu.ucar:httpservices:jar:4.5.5:compile
[INFO] |  |  |  +- org.apache.commons:commons-csv:jar:1.8:compile
[INFO] |  |  |  +- org.apache.sis.core:sis-utility:jar:1.0:compile
[INFO] |  |  |  |  \- javax.measure:unit-api:jar:1.0:compile
[INFO] |  |  |  +- org.apache.sis.storage:sis-netcdf:jar:1.0:compile
[INFO] |  |  |  |  +- org.apache.sis.storage:sis-storage:jar:1.0:compile
[INFO] |  |  |  |  |  \- org.apache.sis.core:sis-feature:jar:1.0:compile
[INFO] |  |  |  |  \- org.apache.sis.core:sis-referencing:jar:1.0:compile
[INFO] |  |  |  +- org.apache.sis.core:sis-metadata:jar:1.0:compile
[INFO] |  |  |  +- org.opengis:geoapi:jar:3.0.1:compile
[INFO] |  |  |  +- edu.usc.ir:sentiment-analysis-parser:jar:0.1:compile
[INFO] |  |  |  +- org.apache.pdfbox:jbig2-imageio:jar:3.0.3:compile
[INFO] |  |  |  \- com.github.jai-imageio:jai-imageio-core:jar:1.4.0:compile
[INFO] |  |  +- org.apache.poi:ooxml-schemas:jar:1.4:compile
[INFO] |  |  \- org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec:jar:2.0.0.Final:compile
[INFO] |  +- io.quarkiverse.jsch:quarkus-jsch:jar:1.0.0:compile
[INFO] |  |  +- com.jcraft:jsch:jar:0.1.55:compile
[INFO] |  |  \- com.jcraft:jzlib:jar:1.1.3:compile
[INFO] |  +- de.j21p:pandoraCore:jar:1.0-SNAPSHOT:compile
[INFO] |  |  +- de.j21p:janUtils:jar:1.0-SNAPSHOT:compile
[INFO] |  |  |  +- net.sourceforge.jexcelapi:jxl:jar:2.6.12:compile
[INFO] |  |  |  +- com.opencsv:opencsv:jar:5.5:compile
[INFO] |  |  |  |  +- org.apache.commons:commons-text:jar:1.9:compile
[INFO] |  |  |  |  \- commons-beanutils:commons-beanutils:jar:1.9.4:compile
[INFO] |  |  |  |     \- commons-collections:commons-collections:jar:3.2.2:compile
[INFO] |  |  |  \- software.amazon.awssdk:lambda:jar:2.17.166:compile
[INFO] |  |  +- de.j21p:janus-filesystem:jar:1.0-SNAPSHOT:compile
[INFO] |  |  |  \- software.amazon.awssdk:s3:jar:2.17.166:compile
[INFO] |  |  |     +- software.amazon.awssdk:aws-xml-protocol:jar:2.17.166:compile
[INFO] |  |  |     |  \- software.amazon.awssdk:aws-query-protocol:jar:2.17.166:compile
[INFO] |  |  |     \- software.amazon.awssdk:arns:jar:2.17.166:compile
[INFO] |  |  +- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] |  |  +- org.beanshell:bsh:jar:2.0b4:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2:compile
[INFO] |  |  \- com.github.oboehm:gdv-xport-lib:jar:6.0.1:compile
[INFO] |  |     +- commons-cli:commons-cli:jar:1.5.0:compile
[INFO] |  |     +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] |  |     +- net.java.dev.stax-utils:stax-utils:jar:20070216:compile
[INFO] |  |     +- org.hsqldb:hsqldb:jar:2.5.2:compile
[INFO] |  |     +- org.patterntesting:patterntesting-rt:jar:2.0.2:compile
[INFO] |  |     |  +- org.aspectj:aspectjrt:jar:1.8.14:compile
[INFO] |  |     |  +- de.aosd.clazzfish:clazzfish-jdbc:jar:1.0:compile
[INFO] |  |     |  |  \- de.aosd.clazzfish:clazzfish-monitor:jar:1.0:compile
[INFO] |  |     |  \- javax.validation:validation-api:jar:2.0.1.Final:compile
[INFO] |  |     +- net.sf.oval:oval:jar:1.90:compile
[INFO] |  |     +- de.jfachwert:jfachwert:jar:4.0.4:compile
[INFO] |  |     |  +- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.6.21:compile
[INFO] |  |     |  |  +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.6.21:compile
[INFO] |  |     |  |  |  +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.6.21:compile
[INFO] |  |     |  |  |  \- org.jetbrains:annotations:jar:13.0:compile
[INFO] |  |     |  |  \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.6.21:compile
[INFO] |  |     |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  |     |  \- org.mutabilitydetector:MutabilityDetector:jar:0.10.4:compile
[INFO] |  |     |     \- org.hamcrest:hamcrest-core:jar:2.2:compile
[INFO] |  |     \- javax.money:money-api:jar:1.1:compile
[INFO] |  +- io.quarkus:quarkus-awt:jar:2.9.0.Final:compile
[INFO] |  \- de.j21p:janus-data:jar:1.0-SNAPSHOT:compile
[INFO] |     \- software.amazon.awssdk:dynamodb-enhanced:jar:2.17.166:compile
[INFO] +- io.quarkus:quarkus-junit5:jar:2.9.0.Final:test
[INFO] |  +- io.quarkus:quarkus-bootstrap-core:jar:2.9.0.Final:test
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-app-model:jar:2.9.0.Final:test
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-maven-resolver:jar:2.9.0.Final:test
[INFO] |  |  |  +- org.apache.maven:maven-embedder:jar:3.8.4:test
[INFO] |  |  |  |  +- org.apache.maven:maven-settings:jar:3.8.4:test
[INFO] |  |  |  |  +- org.apache.maven:maven-core:jar:3.8.4:test
[INFO] |  |  |  |  |  +- org.apache.maven:maven-artifact:jar:3.8.4:test
[INFO] |  |  |  |  |  \- org.codehaus.plexus:plexus-component-annotations:jar:2.1.0:test
[INFO] |  |  |  |  +- org.apache.maven:maven-plugin-api:jar:3.8.4:test
[INFO] |  |  |  |  +- org.apache.maven:maven-model:jar:3.8.4:test
[INFO] |  |  |  |  +- org.apache.maven:maven-model-builder:jar:3.8.4:test
[INFO] |  |  |  |  +- org.apache.maven:maven-builder-support:jar:3.8.4:test
[INFO] |  |  |  |  +- org.apache.maven.resolver:maven-resolver-api:jar:1.6.3:test
[INFO] |  |  |  |  +- org.apache.maven.resolver:maven-resolver-util:jar:1.6.3:test
[INFO] |  |  |  |  +- org.apache.maven.shared:maven-shared-utils:jar:3.3.4:test
[INFO] |  |  |  |  +- com.google.inject:guice:jar:no_aop:4.2.2:test
[INFO] |  |  |  |  +- org.codehaus.plexus:plexus-classworlds:jar:2.6.0:test
[INFO] |  |  |  |  +- org.codehaus.plexus:plexus-sec-dispatcher:jar:2.0:test
[INFO] |  |  |  |  \- org.codehaus.plexus:plexus-cipher:jar:2.0:test
[INFO] |  |  |  +- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.5:test
[INFO] |  |  |  +- org.apache.maven:maven-settings-builder:jar:3.8.4:test
[INFO] |  |  |  |  \- org.codehaus.plexus:plexus-interpolation:jar:1.26:test
[INFO] |  |  |  +- org.apache.maven:maven-resolver-provider:jar:3.8.4:test
[INFO] |  |  |  |  +- org.apache.maven:maven-repository-metadata:jar:3.8.4:test
[INFO] |  |  |  |  +- org.apache.maven.resolver:maven-resolver-spi:jar:1.6.3:test
[INFO] |  |  |  |  +- org.apache.maven.resolver:maven-resolver-impl:jar:1.6.3:test
[INFO] |  |  |  |  \- org.codehaus.plexus:plexus-utils:jar:3.3.0:test
[INFO] |  |  |  +- org.apache.maven.resolver:maven-resolver-connector-basic:jar:1.6.3:test
[INFO] |  |  |  +- org.apache.maven.resolver:maven-resolver-transport-wagon:jar:1.6.3:test
[INFO] |  |  |  +- org.apache.maven.wagon:wagon-http:jar:3.4.3:test
[INFO] |  |  |  |  +- org.apache.maven.wagon:wagon-http-shared:jar:3.4.3:test
[INFO] |  |  |  |  \- org.apache.maven.wagon:wagon-provider-api:jar:3.4.3:test
[INFO] |  |  |  \- org.apache.maven.wagon:wagon-file:jar:3.4.3:test
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-gradle-resolver:jar:2.9.0.Final:test
[INFO] |  |  \- io.smallrye.common:smallrye-common-io:jar:1.11.0:compile
[INFO] |  +- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.5:test
[INFO] |  +- io.quarkus:quarkus-test-common:jar:2.9.0.Final:test
[INFO] |  |  +- io.quarkus:quarkus-core-deployment:jar:2.9.0.Final:test
[INFO] |  |  |  +- org.aesh:readline:jar:2.2:test
[INFO] |  |  |  |  \- org.fusesource.jansi:jansi:jar:1.18:test
[INFO] |  |  |  +- org.aesh:aesh:jar:2.6:test
[INFO] |  |  |  +- io.quarkus.gizmo:gizmo:jar:1.0.10.Final:test
[INFO] |  |  |  |  \- org.ow2.asm:asm-util:jar:9.2:test
[INFO] |  |  |  +- org.ow2.asm:asm-commons:jar:9.3:test
[INFO] |  |  |  |  +- org.ow2.asm:asm-tree:jar:9.3:test
[INFO] |  |  |  |  \- org.ow2.asm:asm-analysis:jar:9.3:test
[INFO] |  |  |  +- io.quarkus:quarkus-class-change-agent:jar:2.9.0.Final:test
[INFO] |  |  |  +- io.quarkus:quarkus-devtools-utilities:jar:2.9.0.Final:test
[INFO] |  |  |  +- io.quarkus:quarkus-builder:jar:2.9.0.Final:test
[INFO] |  |  |  \- org.junit.platform:junit-platform-launcher:jar:1.8.2:test
[INFO] |  |  \- org.jboss:jandex:jar:2.4.2.Final:test
[INFO] |  +- io.quarkus:quarkus-junit5-properties:jar:2.9.0.Final:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.8.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-api:jar:5.8.2:test
[INFO] |  |  |  +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |  |  |  +- org.junit.platform:junit-platform-commons:jar:1.8.2:test
[INFO] |  |  |  \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.8.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.8.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.8.2:test
[INFO] |  \- com.thoughtworks.xstream:xstream:jar:1.4.19:test
[INFO] |     \- io.github.x-stream:mxparser:jar:1.2.2:test
[INFO] |        \- xmlpull:xmlpull:jar:1.1.3.1:test
[INFO] \- io.rest-assured:rest-assured:jar:4.5.1:test
[INFO]    +- org.codehaus.groovy:groovy:jar:3.0.9:test
[INFO]    +- org.codehaus.groovy:groovy-xml:jar:3.0.9:test
[INFO]    +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO]    |  +- org.apache.httpcomponents:httpcore:jar:4.4.15:compile
[INFO]    |  \- commons-codec:commons-codec:jar:1.15:compile
[INFO]    +- org.apache.httpcomponents:httpmime:jar:4.5.13:compile
[INFO]    +- org.hamcrest:hamcrest:jar:2.1:compile
[INFO]    +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:compile
[INFO]    +- io.rest-assured:json-path:jar:4.5.1:test
[INFO]    |  +- org.codehaus.groovy:groovy-json:jar:3.0.9:test
[INFO]    |  \- io.rest-assured:rest-assured-common:jar:4.5.1:test
[INFO]    \- io.rest-assured:xml-path:jar:4.5.1:test
zakkak commented 2 years ago

This works just fine.

So it looks like a GraalVM regression since in 22.0 --link-at-build-time was the default. A reproducer would be great. Thanks @knuspertante !

knuspertante commented 2 years ago

Ah shit sorry I misread your message. Yep, it just worked with --allow-incomplete-classpath

zakkak commented 2 years ago

Ah shit sorry I misread your message. Yep, it just worked with --allow-incomplete-classpath

So does it break with 22.0 and without --allow-incomplete-classpath?

knuspertante commented 2 years ago

Hey @zakkak

So does it break with 22.0 and without --allow-incomplete-classpath?

It still works with GraalVM 22.1 and without --allow-incomplete-classpath? Only if --link-at-build-time is added by quarkus version >= 2.8 it does not work any more.

This works (Quarkus 2.7.5.Final)

/home/ubuntu/graalvm-ee-java17-22.1.0/bin/native-image -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Dfile.encoding=UTF-8 -H:-ParseOnce -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED --initialize-at-run-time=ucar.nc2.grib.grib2,net.sf.oval.ogn.ObjectGraphNavigatorJXPathImpl,de.j21p.janus.filesystem.AwsS3Objects,org.apache.poi.ss.util.SheetUtil,net.sf.oval.expression,org.apache.sis.internal.system.DelayedExecutor,org.apache.sis.internal.system.ReferenceQueueConsumer --no-fallback -H:ResourceConfigurationFiles=resource-config.json -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 -H:+ReportExceptionStackTraces -J-Xmx8g -H:+AddAllCharsets -H:EnableURLProtocols=http,https -H:NativeLinkerOption=-no-pie -H:-UseServiceLoaderFeature -H:+StackTrace janus-funqy-functions-quarkus-1.0.0-SNAPSHOT-runner -jar janus-funqy-functions-quarkus-1.0.0-SNAPSHOT-runner.jar

This don't work Quarkus 2.9.0.Final

/home/ubuntu/graalvm-ee-java17-22.1.0/bin/native-image -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Dfile.encoding=UTF-8 -H:-ParseOnce -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED --initialize-at-run-time=ucar.nc2.grib.grib2,net.sf.oval.ogn.ObjectGraphNavigatorJXPathImpl,de.j21p.janus.filesystem.AwsS3Objects,org.apache.poi.ss.util.SheetUtil,net.sf.oval.expression,org.apache.sis.internal.system.DelayedExecutor,org.apache.sis.internal.system.ReferenceQueueConsumer --no-fallback -H:ResourceConfigurationFiles=resource-config.json -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 -J-Xmx8g -H:+AddAllCharsets -H:EnableURLProtocols=http,https -H:NativeLinkerOption=-no-pie -H:-UseServiceLoaderFeature -H:+StackTrace janus-funqy-functions-quarkus-1.0.0-SNAPSHOT-runner -jar janus-funqy-functions-quarkus-1.0.0-SNAPSHOT-runner.jar
zakkak commented 2 years ago

Hi @knuspertante, if you had to use --allow-incomplete-classpath prior to Quarkus 2.8 and GraalVM 22.1 then it's expected for your application to no longer work.

What's interesting here is why did you need --allow-incomplete-classpath in the first place. It seems like the application depends on some missing dependency and by passing --allow-incomplete-classpath you allow it to build but it could break at runtime if that dependency gets reached at some point.

If you manage to provide a minimal reproducer it would be great. Otherwise I am afraid there is not much we can do.

knuspertante commented 2 years ago

@zakkak I updated my comment above. Yeah, but with Quarkus 2.7.X I was able to still allow the build with --allow-incomplete-classpath

I updated my comment above

Hey @zakkak

So does it break with 22.0 and without --allow-incomplete-classpath?

It still works with GraalVM 22.1 and without --allow-incomplete-classpath? Only if --link-at-build-time is added by quarkus version >= 2.8 it does not work any more.

This works (Quarkus 2.7.5.Final)

/home/ubuntu/graalvm-ee-java17-22.1.0/bin/native-image -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Dfile.encoding=UTF-8 -H:-ParseOnce -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED --initialize-at-run-time=ucar.nc2.grib.grib2,net.sf.oval.ogn.ObjectGraphNavigatorJXPathImpl,de.j21p.janus.filesystem.AwsS3Objects,org.apache.poi.ss.util.SheetUtil,net.sf.oval.expression,org.apache.sis.internal.system.DelayedExecutor,org.apache.sis.internal.system.ReferenceQueueConsumer --no-fallback -H:ResourceConfigurationFiles=resource-config.json -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 -H:+ReportExceptionStackTraces -J-Xmx8g -H:+AddAllCharsets -H:EnableURLProtocols=http,https -H:NativeLinkerOption=-no-pie -H:-UseServiceLoaderFeature -H:+StackTrace janus-funqy-functions-quarkus-1.0.0-SNAPSHOT-runner -jar janus-funqy-functions-quarkus-1.0.0-SNAPSHOT-runner.jar

This don't work Quarkus 2.9.0.Final

/home/ubuntu/graalvm-ee-java17-22.1.0/bin/native-image -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=3 -J-Duser.language=en -J-Dfile.encoding=UTF-8 -H:-ParseOnce -J--add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED -J--add-opens=java.base/java.text=ALL-UNNAMED --initialize-at-run-time=ucar.nc2.grib.grib2,net.sf.oval.ogn.ObjectGraphNavigatorJXPathImpl,de.j21p.janus.filesystem.AwsS3Objects,org.apache.poi.ss.util.SheetUtil,net.sf.oval.expression,org.apache.sis.internal.system.DelayedExecutor,org.apache.sis.internal.system.ReferenceQueueConsumer --no-fallback -H:ResourceConfigurationFiles=resource-config.json -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 -J-Xmx8g -H:+AddAllCharsets -H:EnableURLProtocols=http,https -H:NativeLinkerOption=-no-pie -H:-UseServiceLoaderFeature -H:+StackTrace janus-funqy-functions-quarkus-1.0.0-SNAPSHOT-runner -jar janus-funqy-functions-quarkus-1.0.0-SNAPSHOT-runner.jar

Sorry, until now I was not able to provide a reproducer, but I hope to get that done in the next few days.

zakkak commented 2 years ago

This works (Quarkus 2.7.5.Final) This don't work Quarkus 2.9.0.Final

None of these releases officially supports GraalVM 22.1 though.

Quarkus 2.7.5 supports GraalVM 21.3 and 2.9.0 supports 22.0

GraalVM 22.1 is currently officially supported only on the main branch of Quarkus and is expected to land in 2.10.x.

Sorry, until now I was not able to provide a reproducer, but I hope to get that done in the next few days.

No worries.

knuspertante commented 2 years ago

@zakkak here is a little reproducer https://github.com/knuspertante/quarkus-link-at-build-time-reproducer ;-)

Thanks for your effort!!!

luneo7 commented 2 years ago

jOOQ is also impacted by this: https://github.com/quarkiverse/quarkus-jooq/issues/73 Maybe we could add a new build item to configure build time linkage... to do not have build time linkage for the extension only and not a global change as described in https://www.graalvm.org/22.1/reference-manual/native-image/BuildConfiguration/

zakkak commented 2 years ago

@knuspertante in your case the issue is that OVal comes with a number of "optional" dependencies which when building a Quarkus native applications are not on the classpath (I will try to make GraalVM reports make that more clear, including the dependencies that are missing).

native-image detects that the code using these optional dependencies is reachable, meaning that generating a Quarkus native application without these dependencies on the classpath will result in a binary that may crash at runtime if these dependencies get reached. By requiring everything that's reachable to be on the classpath at compile-time Quarkus ensures that the resulting binary won't result in any surprises at runtime. The proper way to fix this is to either include the missing dependencies or writing a Quarkus extension for OVal that will make sure the missing dependencies are not seen as reached by GraalVM and that a proper error is thrown to users trying to use these dependencies.

zakkak commented 2 years ago

@luneo7 is this still an issue for you? If I am not mistaken https://github.com/quarkiverse/quarkus-jooq/issues/73#issuecomment-1141852860 hints that this is now resolved for jOOQ.

zakkak commented 2 years ago

I will try to make GraalVM reports make that more clear, including the dependencies that are missing

I created a draft PR regarding this, see https://github.com/oracle/graal/pull/4661

luneo7 commented 2 years ago

@zakkak it will be fixed in jOOQ 3.17, that is not released yet (dunno when it will be released)... I did a work around though... adding libs to the pom so the class path is complete, even if we are not using the libs...

knuspertante commented 2 years ago

@zakkak thanks for your work!

However would it be possible, that we only provide native-image --link-at-build-time=io.quarkus,io.quarkiverse,... or every extension provides its packages/classes instead of a global --link-at-build-time?

Then we do not need for every 3rd-Party lib a extension or substitution which uses optional dependencies.

Karm commented 2 years ago

@knuspertante

Then we do not need for every 3rd-Party lib a extension or substitution which uses optional dependencies.

Not necessarily, see an example with Apache PDFBox with Quarkus native:

https://github.com/quarkusio/quarkus-quickstarts/pull/1154

zhfeng commented 1 year ago

@zakkak we have a similar issue https://github.com/apache/camel-quarkus/issues/4512

scrocquesel commented 11 months ago

we have a similar issue with https://github.com/quarkiverse/quarkus-amazon-services/issues/958. While AWS SDK is supporting native build, it does without link-at-built-time so in the extension we used to provide substitutions to remove the reference to the optional dependency. Unfortunately, a major refactoring in the sdk make things a lot more complicated at first glance, meaning a lot more substitutions, cloned code to maintain and sometimes we just can't @alias fields of inaccessible type.

zakkak commented 11 months ago

Unfortunately, a major refactoring in the sdk make things a lot more complicated at first glance, meaning a lot more substitutions, cloned code to maintain

I totally understand but that's the cost we (the framework developers) pay so that Quarkus users can take full advantage of the benefit of build time initialization.

sometimes we just can't @alias fields of inaccessible type

I might be able to help with this.

scrocquesel commented 11 months ago

Unfortunately, a major refactoring in the sdk make things a lot more complicated at first glance, meaning a lot more substitutions, cloned code to maintain

I totally understand but that's the cost we (the framework developers) pay so that Quarkus users can take full advantage of the benefit of build time initialization.

sometimes we just can't @alias fields of inaccessible type

I might be able to help with this.

Thanks for proposing your help, I finally did manage to find proper code to trim.

SetoKaiba commented 10 months ago

@zakkak I have a requirement to disable --link-at-build-time as well. I'm trying to create an app in Quarkus with Google Cloud Vertex AI SDK.

I can compile it to native image without --link-at-build-time and any substitutions and it works. Here's the working app. https://github.com/SetoKaiba/gcp_test

I can't make it work with --link-at-build-time. Altough I have add some substitutions. I know that --link-at-build-time is the way to find out the problem before. But it just costs time to fix the app with a lot of substitutions. And for my case, even I can't make it work. I'm not sure whether --link-at build-time is a best practise. Even the quarkus-grpc-xds from you guys can't make it work with --link-at-build-time. But it's working without --link-at-build-time. And also, I can compile it by including the jdbc-oracle dependency to disable the --link-at-build-time without any substitutions. Here's the reproduce project. https://github.com/SetoKaiba/gcp_reproduce

And here's the related issues or discussions. https://github.com/quarkusio/quarkus/discussions/37909 https://github.com/googleapis/google-cloud-java/issues/10180 https://github.com/grpc/grpc-java/issues/10781 https://github.com/grpc/grpc-java/issues/9736