Check for klib cross compilation support from the KotlinNativeCompilation - #2738
Conversation
|
Can you rebase the PR on main? |
|
Thanks for the contribution. |
|
It looks like this change introduces a Gradle Configuration Cache invalidation issue for projects using Kotlin Multiplatform with Kotlin Native targets. Migrating to |
|
@Tapchicoma is there an underlying issue with the provider, or is it being used incorrectly here? |
|
It's possible that KotlinNativeCompilation object in not serializable, potentially ? |
|
|
|
Actually to me it seems that, after the first build KGP creates some file which make the config cache not reusable during the second build. Calculating task graph as configuration cache cannot be reused because the file system entry 'annotations/build/kotlin/kotlin-project-shared-data/crossCompilationMetadata_linuxX64ApiElements.json' has been created. @Tapchicoma can you comment on the creation of crossCompilationMetadata_linuxX64ApiElements.json |
|
|
|
The problem is this arifacts is something that is produced by the execution phase. So what seems to be happening is that in the first run (fresh gradle run), Gradle records this json file as a configuration input (but it doesnt exist yet). Then the build executes and the file is created. On the next build, Gradle checks if it can re-use the configuration cache - but it sees that the file now exists which does not match the state it stored before so it invalidates the cache and reruns full configuration. This is my (possibly wrong?) understanding of what is going on here. Does that have any truth in it? |
Added to Kotlin for 2.3.20