https://kotlinlang.org logo
#gradle
Title
# gradle
e

eygraber

11/27/2023, 11:09 PM
What's the best way to track down the cause of:
Copy code
> Task :integration-tests:ksp:kspTestKotlinWasmJs FAILED
w: duplicate library name: kotlin
e: warnings found and -Werror specified
Ah, you commented on those so probably not what you were looking for, sorry 😅
e

eygraber

11/27/2023, 11:15 PM
It might be related to KT-62653 because there is some non-standard source set usage in this project so I'll look into that
Looks unrelated 😓
j

Jeff Lockhart

11/27/2023, 11:39 PM
I think KT-51110 is the root tracking issue. "kotlin" being the library does seem odd though. Is that the standard lib? You could print your dependency tree with
./gradlew :integration-tests:ksp:dependencies > dependencies.txt
and search the output dependencies.txt for where different versions are stemming from.
e

eygraber

11/27/2023, 11:52 PM
The only thing that looks out of place there is
Copy code
|    +--- com.google.devtools.ksp:symbol-processing-api:1.9.21-1.0.15
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0
|    |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.0 -> 1.9.21 (*)
I wouldn't expect ksp
1.9.21-1.0.15
to be depending on
stdlib:1.9.0
j

Jeff Lockhart

11/28/2023, 12:05 AM
e

eygraber

11/28/2023, 12:06 AM
Even still, it looks like it's correctly getting switched to use 1.9.21
j

Jeff Lockhart

11/28/2023, 12:08 AM
The way I understand this bug, it doesn't matter that transitive dependencies should be getting updated to the newer version declared by the project. For some reason Kotlin/JS and Kotlin/Native spit out that warning anyway.
e

eygraber

11/28/2023, 12:09 AM
In this case it's only happening for wasmJs. js works fine
j

Jeff Lockhart

11/28/2023, 12:21 AM
I guess Kotlin/Wasm is effected too. I see the warning myself for kotlinx-serialization in native targets: > w: duplicate library name: org.jetbrains.kotlinx:kotlinx-serialization-core because kotlinx-datetime declares 1.5.1 and I declare 1.6.1 in my tests. It might be the indirect relationship where, 1.5.1 is a transitive main dependency and 1.6.1 is introduced in tests. I also see this in the dependencies output:
Copy code
+--- org.jetbrains.kotlinx:kotlinx-datetime:0.4.1
|    \--- org.jetbrains.kotlinx:kotlinx-serialization-core:1.5.1 -> 1.6.1
e

eygraber

11/28/2023, 3:04 AM
The underlying issue was relying on a library that was using the
wasm
target and not the
wasmJs
target