-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bazel issue 13553 desugar workaround #1
base: main
Are you sure you want to change the base?
Conversation
8b2c757
to
fa9cf4c
Compare
fa9cf4c
to
6915e45
Compare
@@ -8,3 +8,20 @@ android_binary( | |||
"@maven//:org_jetbrains_kotlinx_kotlinx_coroutines_core_jvm", | |||
], | |||
) | |||
|
|||
java_import( |
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.
This actually needs to be a kt_jvm_import
to preserve the Kotlin metadata
|
||
java_import( | ||
name = "kotlinx_coroutines_core_jvm_fixed", | ||
jars = ["@kotlinx_coroutines_core_fixed//:v1/https/repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.5.0/kotlinx-coroutines-core-jvm-1.5.0.jar"], |
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 also need to supply the srcjar here if you want to use the Intellij aspects
@@ -18,7 +18,13 @@ http_archive( | |||
|
|||
load("@rules_jvm_external//:defs.bzl", "maven_install") | |||
|
|||
overridden_targets = { | |||
# Override the maven dep with the fixed target | |||
"org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm": "@//:kotlinx_coroutines_core_jvm_fixed", |
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.
What's the actual fix? just curious
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.
line 15 in the BUILD file
Looks like this isn't really possible anymore with rules_jvm_external 4.3 and above - the jar isn't visible anymore. (Probably?) caused by bazel-contrib/rules_jvm_external#649. |
@Kernald it's still possible and I made some changes inside rules jvm external to make it easier. I'll try to update this PR today with the new way. |
@Kernald This actually seems to have been fixed using the latest rolling release (6.0.0-pre.20220909.2). |
That's great to know! I guess I might just wait a bit to update rules_jvm_external here. |
The missing classpath issues are still logged to the console though
|
If you want to work around this using the latest
|
We needed to do this to get it to work: https://gist.github.com/aptenodytes-forsteri/772d75cf41644166d8190e125e1ba367
|
PR demonstrating how to work around the desugaring bug that was introduced in the latest version of Kotlin.