apache / camel-quarkus

Apache Camel Quarkus
https://camel.apache.org
Apache License 2.0
251 stars 186 forks source link

kotlin-dsl native compilation fails due to missing jline reflection configuration resource #6147

Open jamesnetherton opened 1 month ago

jamesnetherton commented 1 month ago

Bug description

Quarkus has upgraded Kotlin to 2.x and it results in a native compilation failure for the kotlin-dsl integration tests:

Error: Could not find reflection configuration resource "META-INF/native-image/org.jline/jline-terminal/reflection-config.json".
com.oracle.svm.core.util.UserError$UserException: Could not find reflection configuration resource "META-INF/native-image/org.jline/jline-terminal/reflection-config.json".

The problem comes from kotlin-compiler-embeddable. It shades jline and includes all of it's native-image.properties. However all of the config files referenced like reflection-config.json are missing. Hence compilation fails.

jar tvf ./target/camel-quarkus-integration-test-kotlin-dsl-3.12.0-SNAPSHOT-native-image-source-jar/lib/org.jetbrains.kotlin.kotlin-compiler-embeddable-2.0.0.jar | grep "META-INF/native-image/org.jline/"
   131 Fri Feb 01 00:00:00 GMT 1980 META-INF/native-image/org.jline/jline-terminal-jansi/native-image.properties
   131 Fri Feb 01 00:00:00 GMT 1980 META-INF/native-image/org.jline/jline-terminal-jna/native-image.properties
   131 Fri Feb 01 00:00:00 GMT 1980 META-INF/native-image/org.jline/jline-terminal-jni/native-image.properties
   131 Fri Feb 01 00:00:00 GMT 1980 META-INF/native-image/org.jline/jline-terminal/native-image.properties

We can work around it with ExcludeConfigBuildItem until there is a proper fix.

jamesnetherton commented 1 month ago

Thinking about it some more, maybe ExcludeConfigBuildItem could be the permanent fix, given that the tests are passing fine without any of the jline native-image config being present.

jamesnetherton commented 1 month ago

https://youtrack.jetbrains.com/issue/KT-68829