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

Kotlin 2.0.0-RC3 #258

Merged
merged 28 commits into from
May 20, 2024
Merged

Kotlin 2.0.0-RC3 #258

merged 28 commits into from
May 20, 2024

Conversation

drewhamilton
Copy link
Owner

Kotlin 2.0 enables the new K2 compiler by default, so non-K2 code paths can be removed.

@JakeWharton
Copy link
Collaborator

Can you still opt out though? Or did they completely eliminate the old compiler?

@drewhamilton
Copy link
Owner Author

Hmm possibly setting an old language version like 1.9 would use the non-K2 compiler. I'll test that out.

@drewhamilton
Copy link
Owner Author

Confirmed that non-K2 compilation is still possible with language version 1.9. Unfortunately, adding configurations targeting 1.9 in the existing :poko-tests module caused errors like the one pasted below, so I had to copy/paste a separate :poko-tests-without-k2 module. Is there a better approach than having a separate module to test this?

A problem occurred configuring project ':poko-tests'.
> Inconsistent settings for Kotlin source sets: 'jvmWithoutK2Main' depends on 'commonMain'
  'jvmWithoutK2Main': language version is KOTLIN_1_9
  'commonMain': language version is KOTLIN_2_0
  The language version of the dependent source set must be greater than or equal to that of its dependency.

@JakeWharton
Copy link
Collaborator

Probably not. Although a separate module might be nice because it can be deleted as a unit more easily once the old compiler is gone for good.

@drewhamilton
Copy link
Owner Author

2.0.0-Beta3 doesn't like the way we're setting the JVM toolchain in :poko-tests:

e: file:///.../Poko/poko-tests/build.gradle.kts:16:7: Using 'jvmToolchain(Int): Unit' is an error. Configuring JVM toolchain in the Kotlin target level DSL is prohibited. JVM toolchain feature should be configured in the extension scope as it affects all JVM targets (JVM, Android).

@drewhamilton
Copy link
Owner Author

Found KT-64629: Seems like we can't have multiple JVM targets compiled with different JDKs anymore.

Thinking the best bet will be to build the :poko-tests JVM target multiple times with a build matrix, and to reduce the sample build to a single JDK to keep the total builds per PR at a reasonable level.

@3flex
Copy link
Contributor

3flex commented May 18, 2024

Since it looks like Kotlin 2.0.0 will be based on the same commit as 2.0.0-RC3, would it be possible to get a rebase & a proper release published to Maven Central, even if it's an alpha/beta version?

It will allow upgrades for dependents when Kotlin 2.0.0 drops without having to add snapshot repos. Thanks!

drewhamilton and others added 22 commits May 19, 2024 17:17
Previous superclass, IrDeclarationOriginImpl, was changed to final.
Fails due to: "Using 'jvmToolchain(Int): Unit' is an error. Configuring JVM toolchain in the Kotlin target level DSL is prohibited. JVM toolchain feature should be configured in the extension scope as it affects all JVM targets (JVM, Android)."
Add MppCheckerKind.Common on the assumption that Poko class definitions won't change across platforms.
* KSP 2.0.0-Beta5-1.0.19
* Compose compiler 1.5.11-dev-k2.0.0-Beta5-b5a216d0ac6
* KSP 2.0.0-RC1-1.0.20
* kotlin-compile-testing 0.5.0-alpha07
* Update yarn.lock
* Switch to new compose compiler plugin
KSP 2.0.0-RC3-1.0.20
@drewhamilton
Copy link
Owner Author

drewhamilton commented May 20, 2024

Can do. Since 0.15 is unlikely to need any more releases, I'll merge this PR with Kotlin 2.0.0-RC3 to main and release a 0.16 beta version.

@drewhamilton drewhamilton changed the title Kotlin 2.0 Kotlin 2.0.0-RC3 May 20, 2024
@drewhamilton drewhamilton marked this pull request as ready for review May 20, 2024 00:45
@drewhamilton drewhamilton enabled auto-merge (squash) May 20, 2024 00:47
@drewhamilton drewhamilton merged commit faf72c3 into main May 20, 2024
5 checks passed
@drewhamilton drewhamilton deleted the drew/kotlin-2.0 branch May 20, 2024 00:58
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

Successfully merging this pull request may close these issues.

3 participants