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

ProjectBuilder tests failing when exercising Kotlin multiplatform plugin #21074

Closed
3flex opened this issue Jun 22, 2022 · 3 comments
Closed

ProjectBuilder tests failing when exercising Kotlin multiplatform plugin #21074

3flex opened this issue Jun 22, 2022 · 3 comments
Assignees
Labels
a:bug in:build-services Shared Build Services
Milestone

Comments

@3flex
Copy link
Contributor

3flex commented Jun 22, 2022

Expected Behavior

I can use ProjectBuilder while applying "kotlin-multiplatform" plugin.

Current Behavior

Failure:
Cannot create service of type KotlinScriptEvaluator using method BuildServices.createKotlinScriptEvaluator() as required service of type KotlinScriptBasePluginsApplicator for parameter #7 is not available.

Context

Trying to efficiently test a Gradle plugin that integrates with the Kotlin Gradle plugin.

Steps to Reproduce

Will do if required, but this issue is almost identical to #16774 which was acknowledged and for a while had a release target for a fix. The difference with this issue is that I'm not aware of a workaround #16774 (comment)

Your Environment

Build scan URL:

@donat donat added the in:build-services Shared Build Services label Jun 29, 2022
@donat donat assigned donat, alllex and eskatos and unassigned donat Jun 29, 2022
@donat donat removed the to-triage label Jun 29, 2022
@alllex
Copy link
Member

alllex commented Jun 30, 2022

Sorry that you're having trouble with Gradle!

Your issue lacks information about how to reproduce the problem you're having. A reproducer project can really help us track down and fix your problem quicker. We may also be able to suggest workarounds or ways to avoid the problem if we can reproduce it.

This issue will be closed after 7 days, unless you can provide more information.


The issue may be indeed similar to #16774, however a reproducer is required in order to pinpoint the source of the problem.
The issue could also depend on the specific version of the kotiln multiplatform plugin being used and various other factors.

@3flex
Copy link
Contributor Author

3flex commented Jul 4, 2022

Reproducer: https://github.com/3flex/gradle-21074-demo

I've used Kotlin Gradle Plugin 1.6.10 because it looks like a workaround or fix was added in Kotlin Gradle Plugin 1.6.20.

I've tested KGP 1.6.10 on 7.4.2 (fails), 7.5-20220703235851+0000 (fails) and 7.6-20220704221532+0000 (works), so it seems dd5ea83 has fixed this.

@alllex
Copy link
Member

alllex commented Jul 5, 2022

Thank you for providing the reproducer!

I have manually validated that the issue is not present anymore with KGP 1.6.10 or 1.7.0 when running with latest 7.6 nightly.

To clarify, the root cause of the problem described in this issue matches the one described in the #16774. For future reference, here is the error from the reproducer using ProjectBuilder (KGP 1.6.10, Gradle 7.4.2):

ProjectBuilderTest > test() FAILED
    org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'org.jetbrains.kotlin.multiplatform'.
        at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:173)
...

 Caused by:
        org.gradle.api.reflect.ObjectInstantiationException: Could not create an instance of type org.jetbrains.kotlin.gradle.plugin.BuildEventsListenerRegistryHolder.
            at org.gradle.internal.instantiation.generator.DependencyInjectingInstantiator.doCreate(DependencyInjectingInstantiator.java:69)
...

            Caused by:
            org.gradle.internal.service.ServiceCreationException: Cannot create service of type DefaultBuildEventsListenerRegistry using DefaultBuildEventsListenerRegistry constructor as required service of type BuildEventListenerFactory for parameter #1 is not available.
                at org.gradle.internal.service.DefaultServiceRegistry$FactoryService.bind(DefaultServiceRegistry.java:807)

So it seem to have indeed been fixed in #21135.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug in:build-services Shared Build Services
Projects
None yet
Development

No branches or pull requests

4 participants