This is reproducible here with this command
mvn -DskipTests package
at this repo:
https://github.com/Christewart/eclair/tree/native-image-build
I've tried adding the --initialize-at-run-time=org.sqlite.JDBC with no success
Hmm, so i managed to figure out the issue. But now when i seem to execute it appears that jars from the core project are not available on the classpath
./eclair-node/target/fr.acinq.eclair.boot
fatal error: /home/chris/dev/eclair/eclair-node/target/../../eclair-core/target/akka-actor_2.11-2.4.20.jar (No such file or directory)
The latest iteeration is https://github.com/Christewart/eclair/commit/55a14b5f7e993c310513d08b6f69c0b74427fd10
The error I am running into now is
Warning: Aborting stand-alone image build. com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved type during parsing: ch.qos.logback.classic.gaffer.GafferConfigurator. To diagnose the issue you can use the --allow-incomplete-classpath option. The missing type is then reported at run time when it is accessed the first time.
Detailed message:
Trace:
at parsing ch.qos.logback.classic.gaffer.GafferUtil.runGafferConfiguratorOn(GafferUtil.java:43)
Call path from entry point to ch.qos.logback.classic.gaffer.GafferUtil.runGafferConfiguratorOn(LoggerContext, Object, URL):
at ch.qos.logback.classic.gaffer.GafferUtil.runGafferConfiguratorOn(GafferUtil.java:41)
at ch.qos.logback.classic.joran.ReconfigureOnChangeTask.run(ReconfigureOnChangeTask.java:71)
at com.oracle.svm.core.jdk.RuntimeSupport.executeHooks(RuntimeSupport.java:144)
at com.oracle.svm.core.jdk.RuntimeSupport.executeStartupHooks(RuntimeSupport.java:89)
at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:139)
at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
Warning: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Starting image-build server instance failed
Caused by: com.oracle.svm.driver.NativeImage$NativeImageError: Could not determine port for sending image-build requests.
Server stdout/stderr:
Did you try using --allow-incomplete-classpath as the error message suggests?
I also tried to get the same project eclair to compile with native-image 19.1.1, following the steps of @Christewart i added --allow-incomplete-classpath and my build args for the native-image executable are --no-fallback -H:Name=eclair-native -H:+ReportExceptionStackTraces --initialize-at-build-time=org.sqlite.JDBC --allow-incomplete-classpath -cp ../eclair-core/target/ the build server seems to reach the analysis phase (with a lots of warnings) at which point it fails with:
Error: Unsupported features in 2 methods
Detailed message:
Error: Parameter 1 of org.sqlite.date.FastDatePrinter$TwelveHourField.<init>(FastDatePrinter$NumberRule) has declared type org.sqlite.date.FastDatePrinter$NumberRule which is incompatible with types in state: MTypeMObject<3:[0x000014D6000042D5:!S:FastDatePrinter$PaddedNumberField, 0x000014D9000042D8:!S:FastDatePrinter$TwoDigitNumberField, 0x000014DA000042D9:!S:FastDatePrinter$UnpaddedNumberField]>
Call path from entry point to org.sqlite.date.FastDatePrinter$TwelveHourField.<init>(FastDatePrinter$NumberRule):
at org.sqlite.date.FastDatePrinter$TwelveHourField.<init>(FastDatePrinter.java:988)
at org.sqlite.date.FastDatePrinter.parsePattern(FastDatePrinter.java:234)
at org.sqlite.date.FastDatePrinter.init(FastDatePrinter.java:162)
at org.sqlite.date.FastDatePrinter.<init>(FastDatePrinter.java:155)
at org.sqlite.date.FastDateFormat.<init>(FastDateFormat.java:394)
at org.sqlite.date.FastDateFormat.<init>(FastDateFormat.java:379)
at org.sqlite.date.FastDateFormat$1.createInstance(FastDateFormat.java:101)
at org.sqlite.date.FastDateFormat$1.createInstance(FastDateFormat.java:98)
at org.sqlite.date.FormatCache.getInstance(FormatCache.java:82)
at org.sqlite.date.FastDateFormat.getInstance(FastDateFormat.java:129)
at org.sqlite.SQLiteConnectionConfig.<init>(SQLiteConnectionConfig.java:20)
at org.sqlite.SQLiteConnectionConfig.copyConfig(SQLiteConnectionConfig.java:55)
at org.sqlite.SQLiteConfig.newConnectionConfig(SQLiteConfig.java:94)
at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:63)
at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:21)
at org.sqlite.JDBC.createConnection(JDBC.java:115)
at org.sqlite.JDBC.connect(JDBC.java:90)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at fr.acinq.eclair.db.Databases$.sqliteJDBC(Databases.scala:52)
at fr.acinq.eclair.Setup.<init>(Setup.scala:96)
at fr.acinq.eclair.Boot$.main(Boot.scala:43)
at fr.acinq.eclair.Boot.main(Boot.scala)
at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:147)
at com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(generated:0)
Is there any chance to get over this?
Addendum: i tried another approach too, using directly the native-image tool on the generated fat jar and specifying the reflection-configuration file i am able to pass the native compilation with --no-fallback but then the binary crashes at startup exiting with code 1 (and zero info attached), what's the best approach?
Most helpful comment
I also tried to get the same project
eclairto compile with native-image 19.1.1, following the steps of @Christewart i added--allow-incomplete-classpathand my build args for thenative-imageexecutable are--no-fallback -H:Name=eclair-native -H:+ReportExceptionStackTraces --initialize-at-build-time=org.sqlite.JDBC --allow-incomplete-classpath -cp ../eclair-core/target/the build server seems to reach the analysis phase (with a lots of warnings) at which point it fails with:Is there any chance to get over this?
Addendum: i tried another approach too, using directly the
native-imagetool on the generated fat jar and specifying the reflection-configuration file i am able to pass the native compilation with--no-fallbackbut then the binary crashes at startup exiting with code 1 (and zero info attached), what's the best approach?