Skip to content
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

Moving to Kotlin 2 (once 2.0.20 is released) #153

Open
ftomassetti opened this issue Jan 19, 2024 · 25 comments
Open

Moving to Kotlin 2 (once 2.0.20 is released) #153

ftomassetti opened this issue Jan 19, 2024 · 25 comments

Comments

@ftomassetti
Copy link
Member

Kotlin 2 is coming, bringing benefits to the multi-platform projects.

Current versions of Kotlin 2 (Kotlin 2.0.0-Beta3 as of now) cannot be used in production, but we may start running experiments to see if there are issues with the Kotlin 2 compiler. In my experience with other projects the migration was rather smooth, but this is a project supporting many platforms and perhaps there could be more suprises.

@lppedd
Copy link
Contributor

lppedd commented Jan 19, 2024

Probably in 3/4 months?
Left is Beta4, and a couple of RCs at least.

We can already try out K2 tho.

@lppedd
Copy link
Contributor

lppedd commented Jan 19, 2024

Just compiled/tested with K2, all good!

@ftomassetti
Copy link
Member Author

Just compiled/tested with K2, all good!

Great!

@ftomassetti
Copy link
Member Author

I guess with Kotlin 2, the K2 compiler is enabled by default, right?

@lppedd
Copy link
Contributor

lppedd commented Jan 22, 2024

Yes, exactly.

K1 will be available for some minor versions IIRC (e.g., 2.2), so there is no rush in case of issues (which we don't have anyway).

@sschuberth
Copy link

Will the generated code improve with K2? This comment seems to hint at it.

@lppedd
Copy link
Contributor

lppedd commented Jan 25, 2024

@sschuberth in this specific case we might benefit of future language capabilities, but the main improvement is a bit of speed up when building.

No changes for generated code, but in case you can be more specific and I can try to answer.

@lppedd
Copy link
Contributor

lppedd commented Feb 13, 2024

I've tested Beta4 today with the K2 IDE.
Still not ready imo, especially the IDE plugin (you can't work in non-JVM or non-Common source sets). We can definitely update to Kotlin 2.0, but we will need to keep the API version at the 1.9 level, as that's where most users will be at for quite some time.

@ftomassetti
Copy link
Member Author

Now Kotlin 2.0.0 has been released, so we could check the situation and decide if we want to move to K2 using API 1.9

@lppedd
Copy link
Contributor

lppedd commented May 24, 2024

I've been observing the situation since beta versions. My advice is to wait until 2.0.20. That's what most issues, and they are a lot, are targeting.

@ftomassetti
Copy link
Member Author

Noted, thank you

@ftomassetti ftomassetti changed the title Moving to Kotlin 2.0 (once it is released) Moving to Kotlin 2 (once 2.0.20 is released) May 24, 2024
@lppedd
Copy link
Contributor

lppedd commented May 27, 2024

Like, stuff like KT-68538 needs to be fixed before considering an update to 2.0+.
It's too risky.

@lppedd
Copy link
Contributor

lppedd commented Jun 10, 2024

2.0.20-Beta1 should be out mid next week.

@JesusMcCloud
Copy link

2.0.20 stable is here

@lppedd
Copy link
Contributor

lppedd commented Aug 23, 2024

@JesusMcCloud I'm going to verify the project compiled on 2.0.20 will be consumable by 1.9.24 without issues on Monday, and then I'll open a PR.

@lppedd
Copy link
Contributor

lppedd commented Aug 23, 2024

Note that I want to deliver one last potentially breaking change before releasing 1.0.0 on Kotlin 2.0.20.

@JesusMcCloud
Copy link

thanks! I just stumbled upon this issue here, because the dependency on an incompatible kotlin-reflect messes with one of our (rather complex) projects on kotlin 2.0.0

@lppedd
Copy link
Contributor

lppedd commented Aug 23, 2024

@JesusMcCloud I guess the dependency you're mentioning is this one:

implementation(kotlin("reflect"))

I'm not sure why it was added, but given we don't depend on reflect features, I'll get rid of it.
Good catch.

@ftomassetti
Copy link
Member Author

Should we move to a newer version of Gradle? here it says that:

Support has been added for Gradle versions 8.6–8.8

perhaps as part of this task we should move to the gradle wrapper 8.8

@lppedd
Copy link
Contributor

lppedd commented Aug 24, 2024

Seems reasonable. I'll do that too, we should get slightly better build times too.

@JesusMcCloud
Copy link

Would it be possible to publish one last intermed. snapshot release before the final one (not talking about RC, but a real snapshot)?

@ftomassetti
Copy link
Member Author

Would it be possible to publish one last intermed. snapshot release before the final one (not talking about RC, but a real snapshot)?

I am not sure we can publish snapshots or how to do that, but if you want I can do another RC

@lppedd
Copy link
Contributor

lppedd commented Aug 29, 2024

My idea is the following.

  1. Merge all remaining open PRs
  2. Release 1.0.0 on Kotlin 1.9.24
  3. Bump to 1.1.0 and move to Kotlin 2.0.20 on K2

@JesusMcCloud
Copy link

Would it be possible to publish one last intermed. snapshot release before the final one (not talking about RC, but a real snapshot)?

I am not sure we can publish snapshots or how to do that, but if you want I can do another RC

Another RC is fine too. Getting rid of reflection is more important to us than K2 at the moment. Would be very much appreciated!

@ftomassetti
Copy link
Member Author

I released RC5 right now.

We can now proceed with the plan suggested by @lppedd and release 1.0.0 and then 1.1.0 however @JesusMcCloud can use RC5 right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants