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

KLib dumps merge: support dumps with different library names

Open fzhinkin opened this issue 1 year ago • 2 comments

Currently, KLib dumps generated for several targets won't be merged with an error if these dumps contain different "unique library names".

In some cases, namely Kotlin Stdlib, the same library may use different unique names depending on the target.

It's worth considering how such a case could be handled by the BCV.

fzhinkin avatar Jul 08 '24 12:07 fzhinkin

We at sqldelight got the same error, we use the (deprecated) archivesBaseName to specify the js module name: https://github.com/cashapp/sqldelight/pull/5444/files#r1750539059

A failure occurred while executing kotlinx.validation.KlibMergeAbiWorker
      > File header doesn't match the header of other files
        [// Rendering settings:, // - Signature version: 2, // - Show manifest properties: true, // - Show declarations: true, , // Library unique name: <app.cash.sqldelight:sqldelight-primitive-adapters>]
        
        
        [// Rendering settings:, // - Signature version: 2, // - Show manifest properties: true, // - Show declarations: true, , // Library unique name: <app.cash.sqldelight:primitive-adapters>]

The solution for our use-case for JS

kotlin {
  js {
    moduleName = "sqldelight-primitive-adapters"
  }
}

does not work with convention plugins (will create a youtrack issue too: https://youtrack.jetbrains.com/issue/KT-71362/KGP-JS-moduleName-is-not-compatible-with-convention-plugins).

hfhbd avatar Sep 09 '24 17:09 hfhbd

Here is another repro: https://github.com/amzn/kotlin-inject-anvil/pull/38

ZacSweers avatar Sep 13 '24 19:09 ZacSweers

As part of the migration of separate BCV functionality to Kotlin Gradle Plugin, the addition of new features to a separate plugin has been discontinued.

It will be developed a format that eliminates this problem there: https://youtrack.jetbrains.com/issue/KT-78009

shanshin avatar Jun 12 '25 16:06 shanshin