tschuchortdev / kotlin-compile-testing

A library for testing Kotlin and Java annotation processors, compiler plugins and code generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kotlin 1.6.20 incompatible

vRallev opened this issue · comments

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' }

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

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)

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

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

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?

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.

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

Same here, the snapshot helps. Thanks!