You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In some cases, the plugin creates incorrect reflect-config.json file with an empty parameterTypes for methods.
To Reproduce
Take the attached project, it contains three commits with working (0.9.11) version and non-working (0.9.12 and 0.9.13).
For 0.9.11 version you can have an empty Ktor project with this build.gradle.xml:
plugins {
application
kotlin("jvm") version "1.7.10"
id("org.graalvm.buildtools.native") version "0.9.11"// build resources via "run" command
}
application.mainClass.set("com.example.ApplicationKt")
repositories.mavenCentral()
dependencies {
implementation("io.ktor:ktor-server-core-jvm:2.0.3")
implementation("io.ktor:ktor-server-cio-jvm:2.0.3")
implementation("ch.qos.logback:logback-classic:1.2.11")
}
graalvmNative {
binaries.named("main") {
agent.enabled.set(true)
}
}
Sorry for a late answer on this one, I've just come back from vacation.
I think the core issue here lies in NBT's custom metadata post-processing - the generated metadata is further filtered and entry values starting with a certain prefix are removed.
These prefixes default to org.gradle, org.junit, and the problematic one: java
Between 0.9.11 and 0.9.12, I've refactored the then post-processing task into an action that's always added to an instrumented task - it seems like on 0.9.11, this task was never triggered.
@jvmusin As a workaround, if you get a chance, could you try adding the following to the graalvmNative configuration in your build.gradle.kts:
Let me know if it still behaves in the wrong way :)
On the NBT side, I think we should remove the java prefix from the post-processing exclude list. Should we also make this action optional and enabled through a property? cc @melix@lazar-mitrovic
Describe the bug
In some cases, the plugin creates incorrect
reflect-config.json
file with an emptyparameterTypes
for methods.To Reproduce
Take the attached project, it contains three commits with working (
0.9.11
) version and non-working (0.9.12
and0.9.13
).For
0.9.11
version you can have an empty Ktor project with thisbuild.gradle.xml
:To finish the program, please open http://localhost:8080/shutdown in your browser.
It creates `reflect-config with the correct entry:
But if you use
0.9.12
with thisbuild.gradle.kts
:Or
0.9.13
with this:Then it creates the entry with an empty
parameterTypes
property which leads to incorrect configs that we can't use for building a correct image:Expected behavior
I expect the
parameterTypes
property to containjava.lang.String
.System Info (please complete the following information):
macOS 12.4 Monterey
22.1 CE
11
native-gradle-plugin:0.9.13
graalvm-reflect-config-issue.zip
The text was updated successfully, but these errors were encountered: