graalvm / native-build-tools

Native-image plugins for various build tools
https://graalvm.github.io/native-build-tools/
Other
371 stars 60 forks source link

(Gradle) Running tests with agent fails with "Missing property userCodeFilterPath in agent conditional configuration" #554

Open abelsromero opened 11 months ago

abelsromero commented 11 months ago

Describe the bug Running ./gradlew -Pagent nativeTest as per documentation in a project with no configuration (except adding the plugin), fails with

Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to calculate the value of property 'agentOptions'.
        at org.gradle.api.internal.provider.AbstractProperty.finalizeNow(AbstractProperty.java:248)
        at org.gradle.api.internal.provider.AbstractProperty.beforeRead(AbstractProperty.java:239)
        at org.gradle.api.internal.provider.AbstractProperty.calculateOwnValue(AbstractProperty.java:135)
        at org.gradle.api.internal.provider.AbstractMinimalProvider.getOrNull(AbstractMinimalProvider.java:105)
        at org.gradle.api.internal.provider.ProviderResolutionStrategy$1.resolve(ProviderResolutionStrategy.java:27)
        at org.gradle.util.internal.DeferredUtil.unpack(DeferredUtil.java:59)
        at org.gradle.util.internal.DeferredUtil.unpackOrNull(DeferredUtil.java:49)
        at org.gradle.api.internal.tasks.properties.InputParameterUtils.prepareInputParameterValue(InputParameterUtils.java:38)
        at org.gradle.api.internal.tasks.properties.InputParameterUtils.prepareInputParameterValue(InputParameterUtils.java:30)
        ... 72 more
Caused by: org.gradle.api.GradleException: Missing property userCodeFilterPath in agent conditional configuration
        at org.graalvm.buildtools.gradle.internal.agent.AgentConfigurationFactory.lambda$getAgentConfiguration$653f1fdd$1(AgentConfigurationFactory.java:81)
        at org.gradle.api.internal.provider.ValueSupplier$Present.transform(ValueSupplier.java:541)
        at org.gradle.api.internal.provider.TransformBackedProvider.mapValue(TransformBackedProvider.java:91)
        at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:83)

env:

Make sure that you have read the documentation and that you are using the latest plugin version.

To Reproduce

git clone -b add-native-java-compatibility git@github.com:abelsromero/java-parallels.git
cd java-parallels
./gradlew -Pagent nativeTest

Expected behavior It should run tests and provide auto-generated metadata 🙏

Logs

System Info (please complete the following information):

Additional context

abelsromero commented 11 months ago

Looking at the code, it seems the issue is that it's setting the "conditional" mode by default. Forcing the standard works ./gradlew -Pagent=standard nativeTest. But base on other docs, it seems standard should be the default.

sdelamo commented 2 months ago

I hit this issue today as well. @abelsromero workaround of using -Pagent=standard worked