Will the 2.2.0 release of KSP bump the language ve...
# ksp
e
Will the 2.2.0 release of KSP bump the language version? I'm getting the following errors (technically warnings, but I have
-Werror
specified and it isn't yet possible to suppress this one)
Copy code
w: Language version 1.9 is deprecated and its support will be removed in a future version of Kotlin
e: warnings found and -Werror specified
t
Are you using KSP1 or KSP2? Only KSP1 passes language version 1.9 to the compiler. It is necessary so as to specify the old compiler frontend, which KSP1 is written for.
e
Pretty sure I'm using KSP2 but I'll double check
🙏 1
t
The error message is printed by the Kotlin compiler. KSP2 doesn't call the compiler in that way, so it is more like KSP1.
e
My apologies you're right. I thought I switched to KSP2 everywhere, but I guess I missed one
useKSP2=false
😅
t
No worries, glad that KSP2 works for you!
r
Thanks for posting this ya'll, you just saved me a bunch of time. Totally forgot one of my projects had that flag set from quite some time ago.
m
@Ting-Yuan Huang is it already known which version of Kotlin will stop working with KSP1? We still have useKSP2=false in our project because some ksp processors are incredibly slow on KSP2 (we suspect dagger but maybe it's KSP2 not being mature itself). We will be very unhappy if KSP1 is dropped anytime soon. Btw is there any KSP roadmap that I could follow?
t
It's still under discussion but Kotlin 2.3 or AGP 9.0 look like good time frames for me. How slow is it compared to KSP1? Can you share some test projects / details?
m
Project is under NDA, so I cannot share that. We use dagger/hilt a lot and for the biggest (app) module which is still not well modularized kspDebugKotlin on my MacBook is ~20s on KSP1 vs ~35s on KSP2. Sadly I don't know how to isolate which ksp processor takes how much time exactly as we have more of them. I suspect dagger as its annotations touches a lot of files so I assume the input is quite big.
t
If you have some time, a profiling mode is introduced recently and is available in nightly builds (2.2.0-2.0.3-SNAPSHOT). It allows the profiler to be attached to the Gradle daemon, where KSP2 runs (in a worker thread).
m
Thanks, I will try it out. Is it enough to enable the flag and report will be produced, or do I need any other tools?
t
You need to attach the daemon with a profiler of your choice. The profiling mode works some issues around with async profilers.
m
I've run the profiler, used chrome trace. I do not see however time spent in each ksp processor, only overall time spent on the ksp task.
t
Did you use a JVM profiler, or Gradle profiler / build scan? If the later, sorry I should have been clearer that I mean a JVM profiler.