graalvm / native-build-tools

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

Sporadic Gradle failure: access-filter.json already exists #626

Closed jeanbisutti closed 2 weeks ago

jeanbisutti commented 2 months ago

The Native Build Tools Gradle plugin is used in the OpenTelemetry Java instrumentation Github repository.

Sometimes the plugin fails. A failure report example: https://ge.opentelemetry.io/s/2rq2vt7d7bsng/failure?expanded-stacktrace=WyIwLTEtMi0zLTQiXQ#1

The root case:

Caused by: java.nio.file.FileAlreadyExistsException: /tmp/agent-config
at org.graalvm.buildtools.agent.AgentConfiguration.addDefaultAccessFilter(AgentConfiguration.java:156)  
at org.graalvm.buildtools.agent.AgentConfiguration.getAgentCommandLine(AgentConfiguration.java:99)  
at org.gradle.api.internal.provider.ValueSupplier$Present.transform(ValueSupplier.java:519) 

The problem seems to come from the recent changes in the AgentConfiguration class, and released in 0.10.3.

The native agent is not enabled from our build.gradle.kts file or a command line (./gradlew -Pagent). Perhaps some code related to the agent could only be executed if the agent is enabled.

Would you have any workaround to recommend?

Thanks.

dnestoro commented 1 month ago

Please use 0.10.2 version util we fix the problem. Thanks for reporting!