rules_kotlin icon indicating copy to clipboard operation
rules_kotlin copied to clipboard

Remove tag to disable ABI jar production (as of 1.6)

Open cgruber opened this issue 4 years ago • 4 comments

The bug in kotlinc which caused ABI jars to be produced incorrect jars, without accounting for cross-inlining. 1.6 fixes this, so we should be able to use ABI jars reliably in usages of Kotlin 1.6+

cgruber avatar Nov 12 '21 20:11 cgruber

This is the PR that fixed it https://github.com/JetBrains/kotlin/pull/3986 and the related tickets are https://youtrack.jetbrains.com/issue/KT-40133, https://youtrack.jetbrains.com/issue/KT-41381, and https://youtrack.jetbrains.com/issue/KT-40340.

Bencodes avatar Nov 12 '21 20:11 Bencodes

I'm responsible for the jvm-abi-gen changes. While testing this internally we ran into some bugs in kotlinx-metadata (which jvm-abi-gen bundles). The fixes (https://github.com/JetBrains/kotlin/pull/4614, https://github.com/JetBrains/kotlin/pull/4617) for these issues didn't quite make it into the 1.6.0 release, but should be included in the next kotlinx-metadata and compiler releases. Until then you may want to use the previous implementation (via -P plugin:org.jetbrains.kotlin.jvm.abi:useLegacyAbiGen=true), although that one contains a number of other bugs...

Without the fixes above we currently loose the nullability of the underlying types of value classes and the flags that mark interfaces compiled with -Xjvm-default=all or all-compatibility.

Sorry for the inconvenience!

sfs avatar Nov 23 '21 10:11 sfs

@sfs sounds like the fixes are coming in 1.6.10?

nkoroste avatar Dec 03 '21 19:12 nkoroste

Yes, all of the fixes that are relevant for the compiler made it into the 1.6.10 release and we have been using jvm-abi-gen internally with these patches applied for about a week now.


We encountered one more problem internally (https://github.com/JetBrains/kotlin/pull/4677), but this only affects ABI jars imported as dependencies into IntelliJ. In an ideal world that shouldn't be a common use case, though, since it breaks some other IntelliJ features (e.g., decompilation).

sfs avatar Dec 09 '21 13:12 sfs