Skip to content

Conversation

@mvicsokolova
Copy link
Collaborator

When we need kotlinx-atomicfu-runtime dependency:

  • it is used by JS IR transformer of atomicfu compiler plugin -> it should be passed to the compileClasspath
  • JS IR transformer replaces atomic declarations with declarations from kotlinx-atomicfu-runtime -> it should be passed to the runtimeClasspath

In the last release 0.20.1 this dependency was passed as compileOnly + runtimeOnly, that caused the issue:
Could not find "org.jetbrains.kotlin:kotlinx-atomicfu-runtime" in the project that depends on coroutines only. That happened because kotlinx-atomicfu-runtime dependency should've been in the compile classpath of that project and compileOnly dependency could not be found there. Hence, this dependency is fixed back to implementation.

This fix is not final, because now kotlinx-atomicfu-runtime dependency is added in any case, whether the enableJsIrTransformation flag is true or not. That's not completely correct and may cause double dependency warning (#289), though it fixes this issue (https://youtrack.jetbrains.com/issue/KT-57235), that is critical. The problem in the issue is that the project that depends on coroutines and ktor fails with Could not find "org.jetbrains.kotlin:kotlinx-atomicfu-runtime" -- because ktor klib manifest demands this dependency, though it shouldn't (the reason is under research).

…he project that depends on the library with applied atomicfu -> use implementation
@mvicsokolova mvicsokolova requested a review from Tapchicoma April 5, 2023 12:51
@mvicsokolova mvicsokolova merged commit a9a08b9 into develop Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants