Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find "org.jetbrains.kotlinx:atomicfu-cinterop-interop" when using coroutines 1.8.0-RC #379

Closed
mvicsokolova opened this issue Dec 7, 2023 · 1 comment · Fixed by #380
Assignees
Labels
bug gradle regression Major regressions that were not caught in advance and were discovered after the release root-cause-defined The root cause of the regression is defined and preventive steps are taken.

Comments

@mvicsokolova
Copy link
Collaborator

mvicsokolova commented Dec 7, 2023

The following error was reproduced in projects, that depended solely on kotlinx.coroutines 1.8.0-RC and did not have a direct dependency to atomicfu:

> Task :compileKotlinIosArm64 FAILED
e: Could not find "org.jetbrains.kotlinx:atomicfu-cinterop-interop" in [/.konan/klib,/.konan/kotlin-native-prebuilt-macos-aarch64-1.9.21/klib/common, /.konan/kotlin-native-prebuilt-macos-aarch64-1.9.21/klib/platform/ios_arm64]

The reason: kotlinx.coroutines were built with the latest version of atomicfu-gradle-plugin that does not provide a transitive dependency to atomicfu in case of enabled Native IR transformation. Though it is still required, because coroutines use declarations from kotlinx.atomicfu.locks module.

That is a problem on kotlinx.atomicfu side, it should always add the implementation atomicfu dependency for native targets.

The WA is adding atomicfu dependency manually:

val nativeMain by creating {
  dependencies {
    implementation("org.jetbrains.kotlinx:atomicfu:0.23.1")
  }
}

Also, see: Kotlin/kotlinx.coroutines#3968

@mvicsokolova mvicsokolova self-assigned this Dec 7, 2023
@mvicsokolova mvicsokolova added the regression Major regressions that were not caught in advance and were discovered after the release label Dec 12, 2023
@mvicsokolova
Copy link
Collaborator Author

Regression analysis:

The root cause: the only test that covered this scenario was smokeTest project in kotlinx-coroutines integration-testing. It emulates a user project that only depends on the locally published current coroutines. There were no native targets declared in the project, hence the native coroutine klib was not used and the compilation completed successfully.

Preventive steps taken: native targets were added to smokeTest in coroutines, also the user-project test was added to kotlinx-atomicfu to check the build of user projects against the library that uses atomicfu.

@mvicsokolova mvicsokolova added the root-cause-defined The root cause of the regression is defined and preventive steps are taken. label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gradle regression Major regressions that were not caught in advance and were discovered after the release root-cause-defined The root cause of the regression is defined and preventive steps are taken.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant