Update to Kotlin 2.0 #218

Closed
opened 2025-12-30 01:22:22 +01:00 by adam · 11 comments
Owner

Originally created by @odenix on GitHub (Oct 16, 2024).

Pkl currently uses Kotlin 1.7.
Kotlin 2.0 was released in May 2024.
2.0 offers many internal and user-facing improvements over 1.7.
Updating to 2.0 means that Pkl's Kotlin libraries will require Kotlin 2.0 or higher.

I'd love to take this on if I get the green light from the Pkl team.

Originally created by @odenix on GitHub (Oct 16, 2024). Pkl currently uses Kotlin 1.7. Kotlin 2.0 was released in May 2024. 2.0 offers many internal and user-facing improvements over 1.7. Updating to 2.0 means that Pkl's Kotlin libraries will require Kotlin 2.0 or higher. I'd love to take this on if I get the green light from the Pkl team.
adam closed this issue 2025-12-30 01:22:22 +01:00
Author
Owner

@bioball commented on GitHub (Oct 16, 2024):

So far, we've been capping Kotlin's version to that used by the minimum version of Gradle supported by pkl-gradle.
I'm not totally sure if we need to be doing, this, though. pkl-gradle uses a fat jar (pkl-tools) that includes the kotlin stdlib, so it might be okay to untether these two.

In general, I'm also not sure if we want to be on the bleeding edge of Kotlin, because it can be painful for our users to migrate the newer versions of our libraries. We don't actually have a policy in place here, but something like "we are compatible with Kotlin released two years ago" sounds like a good goal to have.

In both of these cases, it should be pretty safe to upgrade to Kotlin 1.8, but not totally sure about 2.0.

@bioball commented on GitHub (Oct 16, 2024): So far, we've been capping Kotlin's version to that used by the minimum version of Gradle supported by pkl-gradle. I'm not totally sure if we need to be doing, this, though. pkl-gradle uses a fat jar (pkl-tools) that includes the kotlin stdlib, so it might be okay to untether these two. In general, I'm also not sure if we want to be on the bleeding edge of Kotlin, because it can be painful for our users to migrate the newer versions of our libraries. We don't actually have a policy in place here, but something like "we are compatible with Kotlin released two years ago" sounds like a good goal to have. In both of these cases, it should be pretty safe to upgrade to Kotlin 1.8, but not totally sure about 2.0.
Author
Owner

@odenix commented on GitHub (Oct 16, 2024):

pkl-gradle shouldn’t impose any limitations (compatibility tests will be the judge).

I’d prefer to update to a Kotlin version that is actively maintained.
Kotlin 1.8 is EOL. Kotlin 1.9 is EOL to the best of my knowledge.
Kotlin 2.0 and 2.1 (currently in beta) are actively maintained.

Minimum Kotlin version supported by latest version of popular Kotlin libraries:

  • clikt (*): 2.0
  • kotest: 1.9 (master: 2.0)
  • kotlinpoet (*): 2.0
  • kotlinx-html (*): 1.9 (master: 2.0)
  • kotlinx-serialization (*): 2.0
  • ktor: 2.0

(*) used by Pkl

@odenix commented on GitHub (Oct 16, 2024): pkl-gradle shouldn’t impose any limitations (compatibility tests will be the judge). I’d prefer to update to a Kotlin version that is actively maintained. Kotlin 1.8 is EOL. Kotlin 1.9 is EOL to the best of my knowledge. Kotlin 2.0 and 2.1 (currently in beta) are actively maintained. Minimum Kotlin version supported by latest version of popular Kotlin libraries: * clikt (*): 2.0 * kotest: 1.9 (master: 2.0) * kotlinpoet (*): 2.0 * kotlinx-html (*): 1.9 (master: 2.0) * kotlinx-serialization (*): 2.0 * ktor: 2.0 (*) used by Pkl
Author
Owner

@bioball commented on GitHub (Oct 17, 2024):

That's compelling. If Kotlin 1.9 EOL, that's a good enough reason to upgrade.

By the way, I don't see any materials from JetBrains themselves about this. But endoflife.date claims that 1.9 is EOL.

@jamesward do you have context, and can you advise here?

@bioball commented on GitHub (Oct 17, 2024): That's compelling. If Kotlin 1.9 EOL, that's a good enough reason to upgrade. By the way, I don't see any materials from JetBrains themselves about this. But [endoflife.date](https://endoflife.date/kotlin) claims that 1.9 is EOL. @jamesward do you have context, and can you advise here?
Author
Owner

@odenix commented on GitHub (Oct 17, 2024):

I couldn’t find official information either. Apparently such “formalities” aren’t JetBrain’s strength.
1.9 had some bugfix releases in early 2024, before 2.0 was released. 1.8 is clearly EOL.

@odenix commented on GitHub (Oct 17, 2024): I couldn’t find official information either. Apparently such “formalities” aren’t JetBrain’s strength. 1.9 had some bugfix releases in early 2024, before 2.0 was released. 1.8 is clearly EOL.
Author
Owner

@jamesward commented on GitHub (Oct 17, 2024):

Yeah, I don't think JetBrains has a concept of EOL for Kotlin. But older versions definitely don't get active updates. The latest 1.9 release was July 19, 2024 so not too long ago, and it was after the 2.0.0 release. So likely still some active critical fixes on 1.9.

@jamesward commented on GitHub (Oct 17, 2024): Yeah, I don't think JetBrains has a concept of EOL for Kotlin. But older versions definitely don't get active updates. The latest 1.9 release was July 19, 2024 so not too long ago, and it was after the 2.0.0 release. So likely still some active critical fixes on 1.9.
Author
Owner

@odenix commented on GitHub (Oct 17, 2024):

The latest 1.9 release was July 19, 2024

FWIW I didn’t count 1.9.25 because it says “This is a technical release for IntelliJ IDEA.”
The last time JetBrains shipped a .30 release was Kotlin 1.5.30.
A 1.9.30 branch exists but looks abandoned.
I guess we’ll have to wait and see.

@odenix commented on GitHub (Oct 17, 2024): > The latest 1.9 release was July 19, 2024 FWIW I didn’t count 1.9.25 because it says “This is a technical release for IntelliJ IDEA.” The last time JetBrains shipped a .30 release was Kotlin 1.5.30. A 1.9.30 branch exists but looks abandoned. I guess we’ll have to wait and see.
Author
Owner

@StefMa commented on GitHub (Oct 17, 2024):

Please note that Jetbrains "only" changed the compiler backend in version 2.0, rather than shipping tons of new features or removing deprecated items (which is what the name might suggest). I guess there wouldn't be much difference in choosing version 2.0 over 1.9...

@StefMa commented on GitHub (Oct 17, 2024): Please note that Jetbrains "only" changed the compiler backend in version 2.0, rather than shipping tons of new features or removing deprecated items (which is what the name might suggest). I guess there wouldn't be much difference in choosing version 2.0 over 1.9...
Author
Owner

@odenix commented on GitHub (Oct 18, 2024):

I'll send a PR after the 0.27 release.

@odenix commented on GitHub (Oct 18, 2024): I'll send a PR after the 0.27 release.
Author
Owner

@odenix commented on GitHub (Nov 11, 2024):

I have a PR ready. I'll send it once fewer PRs are in flight.

@odenix commented on GitHub (Nov 11, 2024): I have a PR ready. I'll send it once fewer PRs are in flight.
Author
Owner

@KushalP commented on GitHub (Jan 21, 2025):

I have a PR ready. I'll send it once fewer PRs are in flight.

@odenix is there anything else remaining on this? Would be interesting to see this open in draft.

@KushalP commented on GitHub (Jan 21, 2025): > I have a PR ready. I'll send it once fewer PRs are in flight. @odenix is there anything else remaining on this? Would be interesting to see this open in draft.
Author
Owner

@odenix commented on GitHub (Jan 24, 2025):

Fixed by #900 .

@odenix commented on GitHub (Jan 24, 2025): Fixed by #900 .
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#218