Hello everyone, experimenting locally with an upgrade to 2.0.0-RC1, I'm using Gradle 8.7 and getting...
h
Hello everyone, experimenting locally with an upgrade to 2.0.0-RC1, I'm using Gradle 8.7 and getting this compilation error
Copy code
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> Could not isolate parameters org.jetbrains.kotlin.gradle.internal.transforms.BuildToolsApiClasspathEntrySnapshotTransform$Parameters_Decorated@2fc73041 of artifact transform BuildToolsApiClasspathEntrySnapshotTransform
   > Could not isolate value org.jetbrains.kotlin.gradle.internal.transforms.BuildToolsApiClasspathEntrySnapshotTransform$Parameters_Decorated@2fc73041 of type BuildToolsApiClasspathEntrySnapshotTransform.Parameters
      > Could not resolve all files for configuration ':kotlinBuildToolsApiClasspath'.
         > Could not find org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.0-RC1.
           Searched in the following locations:
I find it strange, as I do not see any direct dependency on
org.jetbrains.kotlin:kotlin-build-tools-impl
anywhere. Is it just something we should manually take a dependency on?
t
nope, it is being added by KGP and you should not add it manually. Our tests are running against Gradle 8.7 and we haven't seen this issue. Would be nice if you could open Kotlin issue with repro. cc @Alexander.Likhachev
h
Reproduction might be a bit hard to share, this is on an internal build tool to my company (Amazon). I'll give it a try tomorrow and let you know, thank you 🙂
t
Could not find find org.jetbrains.kotlinkotlin build tools impl2.0.0-RC1
If you are not using
mavenCentral()
- be sure to add this dependency in your artifactory
a
Could you please check if you add
kotlin.incremental.useClasspathSnapshot=false
to your gradle.properties, would it work fine? Also, maybe you have dependency filtering on the repository declaration side?
h
We cannot use
mavenCentral()
internally unfortunately. Has this become a requirement in 2.0.0? We have several projects with 1.9.23 where this has never been requested. I see this package was created for 1.9.0
a
I wonder what the source of artifacts in your case is then? Do you have some internal mirroring repository?
h
Correct, we import them to our central repository and then run Gradle on top of it. As you can imagine, we are forced to do some "gymnastics" to get Gradle to work with this vs. something like
mavenCentral()
, so I'm mostly trying to understand if this is a Kotlin issue or an Amazon one. I'm going to try to add
kotlin-build-tools-impl
as a runtime dependency of the KGP. Me specifically adding it, would it be something that you think might break some behaviour?
Tried the classpathSnapshot = false, works! Well, it complains about another missing package, but progress
Copy code
* What went wrong:
Execution failed for task ':compileKotlin'.
> Could not resolve all files for configuration ':kotlinCompilerPluginClasspathMain'.
   > Could not find org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.0-RC1.
I see that
kotlin-scripting-compiler-embeddable
is not declared as a dependency of the plugin either, which is likely why our internal solution is not providing it
Yup, can confirm that if I add
Copy code
org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.0-RC1
org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.0-RC1
as a runtime dependency of the KGP, it actually ends up building everything as expected. Would you consider having these as explicit runtime dependencies in Maven? It would solve my use case
t
Would you consider having these as explicit runtime dependencies in Maven?
Yes, they are part of our tooling
t
it is added dynamically by KGP here
h
I see, unfortunately this won't work with our internal system. I assume you've done so as the
useClasspathSnapshot
means you require either one or the other right? Would it be possible to mark them as optional then? Similar to what is currently done in https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-gradle-plugin-idea/2.0.0-RC1
c
on the off chance that you are using CodeArtifact for resolution - there are known issues with CodeArtifact resolving KGP, AWS is aiming to have a fix out by end of the month.
h
Unfortunately, my use case is a custom, in-house solution that just really requires everything to be pre-emptively put on the build path otherwise it'll fail. Thank you for that though, I believe we are experimenting with a CodeArtifact based system 🙂
👍 1