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

Build fails when injecting CCUD plugin into existing DV project using develocity.buildCache #25

Open
bigdaz opened this issue Nov 18, 2024 · 0 comments

Comments

@bigdaz
Copy link
Member

bigdaz commented Nov 18, 2024

If a project applies the com.gradle.develocity plugin (but not the CCUD plugin), and that project is configured to use develocity.buildCache, applying the CCUD plugin via init-script will cause the build to fail.

For example given this settings.gradle.kts:

plugins {
    id("com.gradle.develocity").version("3.18.2")
}

develocity {
    buildScan {
        uploadInBackground = false
        termsOfUseUrl = "https://gradle.com/help/legal-terms-of-use"
        termsOfUseAgree = "yes"
    }
}

buildCache {
    remote(develocity.buildCache)
}

rootProject.name = "inject-ccud"

The build fails with this exception (scan):

* What went wrong:
Failed to apply plugin class 'com.gradle.CommonCustomUserDataGradlePlugin'.
> com.gradle.develocity.agent.gradle.internal.a.b_Decorated cannot be cast to com.gradle.develocity.agent.gradle.buildcache.DevelocityBuildCache

Applying the CCUD plugin directly to the project does not cause this failure. However, the issue to that the Develocity and CCUD plugins are loaded in different Classloaders, and the DevelocityBuildCache type is not shared.

This issue can be fixed in the CCUD plugin by marshalling calls between the 2 classloaders.

Reproducer: https://github.com/bigdaz/develocity-ci-injection-issue-19

@bigdaz bigdaz changed the title Applying CCUD plugin to existing DV project using develocity.buildCache will fail Build fails when injecting CCUD plugin into existing DV project using develocity.buildCache Nov 18, 2024
@bigdaz bigdaz transferred this issue from gradle/develocity-ci-injection Dec 12, 2024
@bigdaz bigdaz transferred this issue from gradle/common-custom-user-data-gradle-plugin Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant