Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast issue when bumping from 0.9.28 to 0.10.0 #572

Open
jeanbisutti opened this issue Feb 6, 2024 · 3 comments
Open

Cast issue when bumping from 0.9.28 to 0.10.0 #572

jeanbisutti opened this issue Feb 6, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jeanbisutti
Copy link

Describe the bug

The following issue appears by bumping to 0.10.0 and executing ./gradlew nativeTest:

Could not determine the dependencies of task ':instrumentation:logback:logback-appender-1.0:library:nativeTestCompile'.
> class org.graalvm.buildtools.gradle.internal.GraalVMReachabilityMetadataService$Inject cannot be cast to class org.graalvm.buildtools.gradle.internal.GraalVMReachabilityMetadataService (org.graalvm.buildtools.gradle.internal.GraalVMReachabilityMetadataService$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @3fe70938; org.graalvm.buildtools.gradle.internal.GraalVMReachabilityMetadataService is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @2ad29845)

Native Build Tools configuration: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/acb078bbc34bb6554ee64725751f2c666bf0724d/instrumentation/logback/logback-appender-1.0/library/build.gradle.kts#L41

Failing job: https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/runs/7794531614/job/21256023757

@jeanbisutti jeanbisutti added the bug Something isn't working label Feb 6, 2024
@melix
Copy link
Collaborator

melix commented Feb 6, 2024

This is a side effect of enabling the metadata repository by default, and a consequence of this Gradle bug.

You can workaround by disabling the metadata repository if you don't need it:

graalvmNative {
    metadataRepository {
        enabled.set(false)
    }
}

or, you can add the GraalVM plugin to the buildSrc classpath instead (see the Gradle issue for details)

@dnestoro
Copy link
Collaborator

@jeanbisutti should we close this issue?

@jeanbisutti
Copy link
Author

@dnestoro I have applied a workaround by disabling the metadata repository. After doing this, I had to add GraalVM metadata to the Spring Boot project. So, it seems that the workaround has overridden the metadata repository configuration of the Spring Boot Gradle plugin.

I am ok to close this issue. However, by leaving it open, others could be aware of this issue by bumping Native Build Tools to 0.10.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants