rules_kotlin
rules_kotlin copied to clipboard
JDeps compiler plugin doesn't work under the new k2 compiler
I tried to play with the new k2 compiler now that in 1.7.20 the abi-gen plugin is supported, but the jdeps plugin needs to be updated to support k2. Here is the error that I get:
warning: ATTENTION!
This build uses experimental K2 compiler:
-Xuse-k2
error: there are some plugins incompatible with K2 compiler:
io.bazel.kotlin.plugin.jdeps.JdepsGenComponentRegistrar
Please remove -Xuse-k2
From the kotlin slack, it seems that the rough guide for k2 plugins are here. Mostly we need to switch JdepsGenExtension from AnalysisHandlerExtension to FirExtension
Seems like this will be possible once https://youtrack.jetbrains.com/issue/KT-51982 is done. I wonder if it's possible switch the plugin to KSP...
Full thread: https://slack-chats.kotlinlang.org/t/2910292/it-will-be-done-as-part-of-kapt-support-https-youtrack-jetbr#7f89c88e-2db0-407b-b61d-a9cee20a9faa
@rockwotj are you able to take a look at fixing up the jdeps plugin so that it supports K2?
@rockwotj are you able to take a look at fixing up the jdeps plugin so that it supports K2?
I am hoping to have time, but note that it isn't possible right now until k2 has support for KSP.
has anyone taken up this work now that Kotlin 2.0 is in Beta5?
Unlikely, I at least no longer work on a Kotlin codebase and won't be able to look into this.