Kotlin / binary-compatibility-validator

Public API management tool
Apache License 2.0
800 stars 59 forks source link

Migrate to newer kotlin-metadata-jvm #241

Closed sandwwraith closed 1 month ago

sandwwraith commented 3 months ago

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

fzhinkin commented 3 months ago

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.

lukellmann commented 3 months ago

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

sandwwraith commented 2 months ago

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

fzhinkin commented 2 months ago

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

fzhinkin commented 2 months ago

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

fzhinkin commented 2 months ago

Ok, I'm wrong.

sandwwraith commented 2 months ago

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

fzhinkin commented 2 months ago

No, it's not.

fzhinkin commented 2 months ago

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