-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Change the order of atomicfu and kotlin plugins in the classpath #3984
Conversation
…ugin to the classpath. in the global buildscript: when atomicfu-gradle-plugin is not added to the classpath first, it is not applied at all. When kotlin-gradle-plugin is added first, atomicfu-gradle-plugin is not applied at all and this error is thrown: "e: Module kotlinx.atomicfu cannot be found in the module graph". This behaviour started to reproduce after this change in kotlinx-atomicfu (Kotlin/kotlinx-atomicfu#377). The problem was revealed while running a train build against kotlin-community/dev branches before kotlinx-atomicfu 0.23.2.
@@ -57,9 +57,9 @@ buildscript { | |||
} | |||
|
|||
dependencies { | |||
classpath "org.jetbrains.kotlinx:atomicfu-gradle-plugin:$atomicfu_version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a comment that this line is exactly here for a reason. Otherwise, I promise to forget about this PR when I start reordering all dependencies in the reverse alphabetical order for fun.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done :)
|
I'm going to investigate the root of this problem, most probably it will require the fix on atomicfu side, so we can postpone this change for now |
If this change is invisible to the end user of coroutines (is it?) and a proper fix can't be added quickly (can it?), why not merge this workaround so that the CI is not needlessly red? The only thing missing now is that it can be unclear when we can swap the dependencies again. I think the comment needs a clear link to the issue in atomicfu. When the issue is closed, the outcome should be specified there, like: "Now the order is no longer important" or "We documented why the order will always be like that," so anyone can understand what's happening and why. |
This fix invisible for users and it's true that it blocks the CI build. The reason I wanted to postpone merging is because, the initial purpose of this commit was to check that the train runs fine with the last changes in atomicfu, and after that I wanted to release atomicfu. But now I can not release it without the proper fix to this problem anyway, because it may be reproduced on user projects as well. Though providing this fix may take time, because the reason is not clear yet. I've created the issue in atomicfu: Kotlin/kotlinx-atomicfu#384 |
Yeah, I saw that, I mean that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's good to go. @mvicsokolova, should we merge this?
Yes, I'll merge it |
This commit changes the order of adding atomicfu and kotlin gradle plugin to the classpath. When `kotlin-gradle-plugin` is added first, `atomicfu-gradle-plugin` is not applied at all and this error is thrown: "e: Module kotlinx.atomicfu cannot be found in the module graph". The change of order fixes the issue. Should be properly investigated. This behaviour started to reproduce after this change in kotlinx-atomicfu (Kotlin/kotlinx-atomicfu#377). Here is the corresponding issue in atomicfu: Kotlin/kotlinx-atomicfu#384 (cherry picked from commit 605ec56)
This commit changes the order of adding atomicfu and kotlin gradle plugin to the classpath. When `kotlin-gradle-plugin` is added first, `atomicfu-gradle-plugin` is not applied at all and this error is thrown: "e: Module kotlinx.atomicfu cannot be found in the module graph". The change of order fixes the issue. Should be properly investigated. This behaviour started to reproduce after this change in kotlinx-atomicfu (Kotlin/kotlinx-atomicfu#377). Here is the corresponding issue in atomicfu: Kotlin/kotlinx-atomicfu#384 (cherry picked from commit 605ec56)
This commit changes the order of adding atomicfu and kotlin gradle plugin to the classpath. When `kotlin-gradle-plugin` is added first, `atomicfu-gradle-plugin` is not applied at all and this error is thrown: "e: Module kotlinx.atomicfu cannot be found in the module graph". The change of order fixes the issue. Should be properly investigated. This behaviour started to reproduce after this change in kotlinx-atomicfu (Kotlin/kotlinx-atomicfu#377). Here is the corresponding issue in atomicfu: Kotlin/kotlinx-atomicfu#384 (cherry picked from commit 605ec56)
This commit changes the order of adding atomicfu and kotlin gradle plugin to the classpath. When `kotlin-gradle-plugin` is added first, `atomicfu-gradle-plugin` is not applied at all and this error is thrown: "e: Module kotlinx.atomicfu cannot be found in the module graph". The change of order fixes the issue. Should be properly investigated. This behaviour started to reproduce after this change in kotlinx-atomicfu (Kotlin/kotlinx-atomicfu#377). Here is the corresponding issue in atomicfu: Kotlin/kotlinx-atomicfu#384 (cherry picked from commit 605ec56)
This commit changes the order of adding atomicfu and kotlin gradle plugin to the classpath. When `kotlin-gradle-plugin` is added first, `atomicfu-gradle-plugin` is not applied at all and this error is thrown: "e: Module kotlinx.atomicfu cannot be found in the module graph". The change of order fixes the issue. Should be properly investigated. This behaviour started to reproduce after this change in kotlinx-atomicfu (Kotlin/kotlinx-atomicfu#377). Here is the corresponding issue in atomicfu: Kotlin/kotlinx-atomicfu#384 (cherry picked from commit 605ec56)
A rather obscure problem was revealed while compiling coroutines against the current develop atomicfu branch before 0.23.2 release.
Reproducer:
kotlinx-atomicfu:
develop
branch:clean build publishToMavenLocal
kotlinx.coroutines:
obscure-atomicfu-application-order
branch::kotlinx-coroutines-core:compileKotlinJvm -Patomicfu_version=0.23.1-SNAPSHOT
Reproduced with Kotlin
1.9.20
,1.9.21
and2.0.0-dev-*
The error started to reproduce after these changes in kotlinx-atomicfu#377: (atomicfu compiler plugin should be manually added to the classpath by the user).
Changing the order of
kotlin-gradle-plugin
andatomicfu-gradle-plugin
in the classpath fixes the problem and the train build is now green.What changes is the compile classspath:
Before the fix atomicfu-jvm is not included in the classpath:
After changing the order atomicfu-jvm is in the classpath: