tschuchortdev / kotlin-compile-testing

A library for testing Kotlin and Java annotation processors, compiler plugins and code generation
Mozilla Public License 2.0
659 stars 63 forks source link

Kotlin 1.6.20 incompatible #239

Closed vRallev closed 2 years ago

vRallev commented 2 years ago

I know that Kotlin 1.6.20 isn't out yet. But I tested the dev build and noticed an incompatibility and wanted to raise awareness:

    java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments.setStrictJavaNullabilityAssertions(boolean)'
        at com.tschuchort.compiletesting.KotlinCompilation$commonK2JVMArgs$1.invoke(KotlinCompilation.kt:331)
        at com.tschuchort.compiletesting.KotlinCompilation$commonK2JVMArgs$1.invoke(KotlinCompilation.kt:296)
        at com.tschuchort.compiletesting.AbstractKotlinCompilation.commonArguments(AbstractKotlinCompilation.kt:119)
        at com.tschuchort.compiletesting.KotlinCompilation.commonK2JVMArgs(KotlinCompilation.kt:296)
        at com.tschuchort.compiletesting.KotlinCompilation.compileJvmKotlin(KotlinCompilation.kt:472)
        at com.tschuchort.compiletesting.KotlinCompilation.compile(KotlinCompilation.kt:648)

I used version 1.6.20-dev-7317. You can test this version from:

maven { url 'https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap' }
tschuchortdev commented 2 years ago

I think this was already fixed in 020270e8, so if you use KCT version 1.4.8-SNAPSHOT it should work. Can you confirm?

vRallev commented 2 years ago

This one seems to fixed, but now I'm seeing:

    java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments.setNoExceptionOnExplicitEqualsForBoxedNull(boolean)'
        at com.tschuchort.compiletesting.KotlinCompilation$commonK2JVMArgs$1.invoke(KotlinCompilation.kt:369)
        at com.tschuchort.compiletesting.KotlinCompilation$commonK2JVMArgs$1.invoke(KotlinCompilation.kt:296)
        at com.tschuchort.compiletesting.AbstractKotlinCompilation.commonArguments(AbstractKotlinCompilation.kt:119)
        at com.tschuchort.compiletesting.KotlinCompilation.commonK2JVMArgs(KotlinCompilation.kt:296)
        at com.tschuchort.compiletesting.KotlinCompilation.compileJvmKotlin(KotlinCompilation.kt:474)
        at com.tschuchort.compiletesting.KotlinCompilation.compile(KotlinCompilation.kt:650)
tschuchortdev commented 2 years ago

Apparently, a number of compiler options have been removed in Kotlin 1.6.20. I have fixed them in 91271b0e. However, it seems there is no KSP (pre-)release for 1.6.20 yet, so all the KSP tests fail due to binary incompatibilities.

vRallev commented 2 years ago

Thanks and no worries. I hope KSP catches up as soon as there's a milestone or RC release.

vRallev commented 2 years ago

1.6.20-M1 is out now: https://blog.jetbrains.com/kotlin/2022/02/kotlin-1-6-20-m1-released/ Maybe there's a chance for an alpha release for Kotlin compile testing?

drewhamilton commented 2 years ago

KSP for 1.6.20-M1 is out now.

tschuchortdev commented 2 years ago

I published a snapshot release for 1.6.20, is that sufficient? There is no kotlin-compiler-embeddable release for 1.6.20-M1, so it's now a mix of 1.6.20-M1 and 1.6.20-dev-7317, but it should work.

drewhamilton commented 2 years ago

My tests are passing with your snapshot release now. It looks like there is a kotlin-compiler-embeddable 1.6.20-M1 release though.

vRallev commented 2 years ago

Same here, the snapshot helps. Thanks!