been discovering that the task "kspCommonMainKotli...
# ksp
r
been discovering that the task "kspCommonMainKotlinMetadata" is the only ksp task I've run into that's not yet configuration-cache compatible.
For anyone curious about the related error.
Copy code
Configuration cache state could not be cached: field `__libraries__` of task `:plugins-test:mint-action-test:kspCommonMainKotlinMetadata` of type `com.google.devtools.ksp.gradle.KspTaskMetadata`: error writing value of type 'org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection'
> Querying the mapped value of provider(java.util.Set) before task ':libraries:action:allMetadataJar' has completed is not supported
j
massive delayed bump - you ever figure this out or you just turning off config cache?
r
just checked back. at the time, I discovered I could disable the metadata dependency and things broadly worked. Now I've re-enabled it, and from initial testing it doesn't appear to have this problem anymore with the newer versions of KSP... but I haven't looked too deeply. I'll re-enable that more broadly and see if I run into the problem again. I love me some configuration cache.
j
yeah, failed for me yesterday but not sure if i'm doing something wrong
r
I have seen this crop up again now - its not blocking for me because most things don't actually depend on those metadata tasks, but I can confirm this can still happen
d
Another massive delayed bump 🙂 .. when you say
I discovered I could disable the metadata dependency and things broadly worked.
How did you go about doing that? Im running into this same issue
r
I've upgraded to the latest gradle, kotlin 2, and the associated ksp tasks... AFAICT now this doesn't happen to me anymore. I did run into an issue recently with how K2 plugins handle common code that involved the metadata task not existing unless there's more than one platform listed anyway that's neither here nor there. Skipping it means not registering a ksp handler for the common-metadata sourceset, or alternately disabling the task once its created. for example:
Copy code
configurations.names.forEach {
    if (it.startsWith("ksp") && it != "ksp") {
        it("com.zegreatrob.testmints:action-processor:1.0.0")
    }
}
That's an example of applying a ksp processor library to all configurations capable of ksp (after the "com.google.devtools.ksp" plugin has done its thing). In the past, this code had a 'skip if the configuration contains the word common' clause to avoid the pain point i mentioned before.