binary-compatibility-validator icon indicating copy to clipboard operation
binary-compatibility-validator copied to clipboard

Migrate to newer kotlin-metadata-jvm

Open sandwwraith opened this issue 1 year ago • 1 comments

Currently (https://github.com/Kotlin/binary-compatibility-validator/blob/29a83d78596bfdbc37f885da881edc40021eb073/gradle/libs.versions.toml#L18) BCV uses kotlinx-metadata-jvm 0.6.2. This version uses some obsolete APIs, and it is recommended to migrate to the latest stable version with a different package. Moreover, it is required to be able to read Kotlin 2.1 language version (to which master branch of Kotlin will be switched soon).

Changleg and migration guide are available here: https://github.com/JetBrains/kotlin/blob/75c87dd8585147b4abab2ac262fac84a037f07be/libraries/kotlinx-metadata/jvm/Migration.md#L1 https://github.com/JetBrains/kotlin/blob/75c87dd8585147b4abab2ac262fac84a037f07be/libraries/kotlinx-metadata/jvm/ChangeLog.md

sandwwraith avatar Jun 19 '24 13:06 sandwwraith

It's relatively easy to update the code (see update-metadata-lib branch), but kotlin-metadata-jvm:2.0.0 will bring transitive dependency on stdlib:2.0.0, so https://github.com/Kotlin/binary-compatibility-validator/issues/208 needs to be done first.

fzhinkin avatar Jul 02 '24 10:07 fzhinkin

org.jetbrains.kotlinx:kotlinx-metadata-jvm:0.6.2 will also no longer work with Kotlin 2.1.0, see https://github.com/kordlib/kord/commit/9a90ee0f5b669a017a0b04caf53eaee8fd02f9fe

lukellmann avatar Jul 05 '24 21:07 lukellmann

@fzhinkin Is there a problem with releasing just update-metadata-lib? Kotlin master is already switched to 2.1

sandwwraith avatar Jul 12 '24 13:07 sandwwraith

@sandwwraith, the issue with update-metadata-lib is that kotlin-metadata-jvm will bring the stdlib 2.0 as a dependency.

fzhinkin avatar Jul 12 '24 13:07 fzhinkin

Huh, or I'm wrong and it won't be a problem. Let me check.

fzhinkin avatar Jul 12 '24 13:07 fzhinkin

Ok, I'm wrong.

fzhinkin avatar Jul 12 '24 13:07 fzhinkin

But isn't BCV itself using stdlib 2.0 already? 🤔

sandwwraith avatar Jul 12 '24 13:07 sandwwraith

No, it's not.

fzhinkin avatar Jul 12 '24 13:07 fzhinkin

Yeah, I was wrong. Opened the PR: #255. Once it is merged, a new version with Kotlin 2.1 support will be released.

fzhinkin avatar Jul 12 '24 14:07 fzhinkin