This message was deleted.
# community-support
s
This message was deleted.
w
Can you try
8.0 RC3
? This comes with a newer Kotlin version, maybe the problem has been fixed there.
v
That's a problem of the Kotlin Gradle plugin that does not call
usesService
, isn't it? So newer embedded Kotlin version will not help, will it?
j
v
Kotlin Gradle Plugin 1.9 will fix this, there they added the missing
usesService
calls in commit
278229d2face0
, is that enough for you or do you need some workaround now?
j
I think it would be nice that, if I just use
kotlin-dsl
(the plugin embedded in Gradle), I don't get deprecation warnings. As a user, this feels like I am using only Gradle core. I assume this will be "fixed" the in 8.1 by updating the Kotlin plugin to 1.9? (It's not blocking me. I just wanted to give this feedback.) And if there is a good workaround for 8.0 that I can share with others (that does not give me a different warning) I am also happy to hear it.
v
Oh, just with
kotlin-dsl
😕
j
Yes. Unless I did something stupid (which I won't rule out completely 😅 ). It's: https://github.com/jjohannes/idiomatic-gradle
v
I assume this will be "fixed" the in 8.1 by updating the Kotlin plugin to 1.9?
I doubt it will be available by then 😄
I wonder that it even builds when you use Gradle 8. Wasn't that deprecation to be error in Gradle 8? Or was it to be error in Gradle 9?
j
No the deprecation is new with 8. With 7 I don't get it.
v
I think the deprecation should be there in Gradle 7 already, but I guess the Kotlin plugin for the embedded Kotlin version in Gradle 7 does not use services and the embedded Kotlin version in Gradle 8 does.
But it is to be error in Gradle 9 indeed
j
That could be the case.
v
I'd report it to Gradle as regression in 8
That the warnings appear now
Maybe they can somehow get the respective services and do the
usesService
calls as work-around. Which you might also be able to do manually in your build.
j
I can do that. I am just surprised. Gradle's integration tests (e.g. for gradle init) should have caught this.
Mh. I don't get this for a simple project. Must again be some weird combination of things 😕
p
We expected all build services usages to be properly declared in kotlin 1.8.10.
We did not see that warning in our test suite nor usages.
I assume something special in your build is triggering that codepath in KGP.
There's about nothing we can do about it though 😕 Rolling back to Kotlin 1.7 because of that would be really bad.
w
Is the warning only showing up when using the stable configuration cache build feature?
v
According to https://youtrack.jetbrains.com/issue/KT-52149 it was fixed for 1.8.20 and 1.9.0, but not 1.8.10
I switched to Gradle 8.0-rc-3 in my almost empty play project and did
:build-logic:compileKotlin
and immediately got
Copy code
Build service 'variant_impl_factories_1150915352' is being used by task ':build-src:compileKotlin' without the corresponding declaration via 'Task#usesService'. This behavior has been deprecated. This will fail with an error in Gradle 9.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: <https://docs.gradle.org/8.0-rc-3/userguide/upgrading_version_7.html#undeclared_build_service_usage>
Build service 'org.jetbrains.kotlin.compilerRunner.CompilerSystemPropertiesService_1150915352' is being used by task ':build-src:compileKotlin' without the corresponding declaration via 'Task#usesService'. This behavior has been deprecated. This will fail with an error in Gradle 9.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: <https://docs.gradle.org/8.0-rc-3/userguide/upgrading_version_7.html#undeclared_build_service_usage>
Build service 'org.jetbrains.kotlin.gradle.incremental.IncrementalModuleInfoBuildService_1150915352' is being used by task ':build-src:compileKotlin' without the corresponding declaration via 'Task#usesService'. This behavior has been deprecated. This will fail with an error in Gradle 9.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: <https://docs.gradle.org/8.0-rc-3/userguide/upgrading_version_7.html#undeclared_build_service_usage>
Invocation of Task.project at execution time has been deprecated. This will fail with an error in Gradle 9.0. Consult the upgrading guide for further information: <https://docs.gradle.org/8.0-rc-3/userguide/upgrading_version_7.html#task_project>
j
Is the warning only showing up when using the stable configuration cache build feature?
Yes. That's it I think. Thanks! Missed that this was also just turned on in the project 😬
That makes sense I guess. All good then from my side.
👍 1
p
Same for you Björn?
v
Yes,
build-src
does not have the feature enabled, but the root build has. If I comment it out, no warning is shown. if I comment it back in, the warning comes back.
But as the docs suggested to enable the feature as soon as possible on all builds, it is likely this will happen for many users out there I guess.
p
Ok thanks
Yes, but that's fine. Configuration cache is still incubating at this stage.
😭 1
Don't cry, it'll be marked as stable sooner than you might think 🙂
v
When the hackathon was, it was said 8.0. But I've seen somewhere it should be 8.1 now.
p
I think what was said was 8.x. And yes this is scheduled for 8.1 now.
party gradlephant 1
We never tied marking it stable to a major version.
v
Could well be I misremeber :-)
Copy code
tasks.compileKotlin {
    usesService(org.jetbrains.kotlin.gradle.plugin.VariantImplementationFactories.getProvider(gradle))
}
🙂
👍 2
c
thanks for this discussion - had been seeing pages of warnings/stacktraces going by on 8.0-rc*, hadn’t had a chance to get around to them yet - glad to see this will be fixed soon and can be worked around.
👌 1
Now to figure out the remaining two related warnings:
Copy code
Build service 'org.jetbrains.kotlin.compilerRunner.CompilerSystemPropertiesService_1310369408' is being used by task ':plugins:base:compileKotlin' without the corresponding declaration via 'Task#usesService'. This behavior has been deprecated. This will fail with an error in Gradle 9.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: <https://docs.gradle.org/8.0-rc-5/userguide/upgrading_version_7.html#undeclared_build_service_usage>
Build service 'org.jetbrains.kotlin.gradle.incremental.IncrementalModuleInfoBuildService_1310369408' is being used by task ':plugins:base:compileKotlin' without the corresponding declaration via 'Task#usesService'. This behavior has been deprecated. This will fail with an error in Gradle 9.0. Declare the association between the task and the build service using 'Task#usesService'. Consult the upgrading guide for further information: <https://docs.gradle.org/8.0-rc-5/userguide/upgrading_version_7.html#undeclared_build_service_usage>
also from
kotlin-dsl
, somewhere…
v
Probably similar to the one I looked up in source. 🙂 Or you wait for 1.8.20 where it is fixed or disable the stable configuration cache feature. 🙂