ktorio / ktor

Framework for quickly creating connected applications in Kotlin with minimal effort
https://ktor.io
Apache License 2.0
12.86k stars 1.04k forks source link

WA: Disable JS legacy transformation manually until it is completely removed from the atomicfu plugin. #4313

Closed mvicsokolova closed 1 week ago

mvicsokolova commented 3 weeks ago

This change fixes this train failure.

e: KLIB resolver: The same 'unique_name=io.ktor:ktor-io' found in more than one library: /mnt/agent/work/1edc2f021dd239f7/project.ktor/ktor-io/build/classes/atomicfu/js/main, /mnt/agent/work/1edc2f021dd239f7/project.ktor/ktor-io/build/classes/kotlin/js/main
Please file an issue to https://kotl.in/issue and meanwhile use CLI flag `-Xklib-duplicated-unique-name-strategy` with one of the following values:
allow-all-with-warning: Use all KLIB dependencies, even when they have same `unique_name` property.
allow-first-with-warning: Use the first KLIB dependency with clashing `unique_name` property. No order guarantees are given though.
deny: Fail a compilation with the error.

Through an oversight atomicfu-gradle-plugin kept tranformJs option (corresponding to the legacy JS transformation) enabled by default, and with no *.js files to transform it just copied the compileJs output directory.

Here is the similar fix merged into kotlinx.coroutines: https://github.com/Kotlin/kotlinx.coroutines/pull/4223

bjhham commented 2 weeks ago

Could you check the CI build error?

Error:

org.gradle.api.InvalidUserCodeException: Querying the mapped value of map(flatmap(provider(task 'generatePrecompiledScriptPluginAccessors', class org.gradle.kotlin.dsl.provider.plugins.precompiled.tasks.GeneratePrecompiledScriptPluginAccessors))) before task ':buildSrc:generatePrecompiledScriptPluginAccessors' has completed is not supported

Scan: https://scans.gradle.com/s/sabm6fewg2hke

mvicsokolova commented 1 week ago

Seems that now, my fix is not the reason of the build failure anymore. @bjhham could please have a look? 🙏

Also, I've changed the base branch from kotlin-community to main. I'm not sure, what is the process of providing the fixes for the kotlin-community in ktor, but at least in other kotlinx libraries, the fix should appear in the dev branch first.

e5l commented 1 week ago

LGTM, will be merged after CI check