rules_kotlin icon indicating copy to clipboard operation
rules_kotlin copied to clipboard

JDeps compiler plugin doesn't work under the new k2 compiler

Open rockwotj opened this issue 3 years ago • 6 comments

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

rockwotj avatar Oct 10 '22 17:10 rockwotj

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...

rockwotj avatar Oct 11 '22 11:10 rockwotj

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 avatar Oct 11 '22 11:10 rockwotj

@rockwotj are you able to take a look at fixing up the jdeps plugin so that it supports K2?

Bencodes avatar Oct 14 '22 20:10 Bencodes

@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.

rockwotj avatar Oct 14 '22 20:10 rockwotj

has anyone taken up this work now that Kotlin 2.0 is in Beta5?

jbarr21 avatar Apr 04 '24 22:04 jbarr21

Unlikely, I at least no longer work on a Kotlin codebase and won't be able to look into this.

rockwotj avatar Apr 04 '24 23:04 rockwotj