https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
j

jessewilson

11/20/2023, 7:22 PM
I’m looking into some
IrLinkageError
crashes. We’ve got two libraries that each depend on different versions a common native library: • Native library Z depended on
co.touchlab:sqliter-driver:1.0.10
• Native library S depended on
co.touchlab:sqliter-driver:1.2.3
Unfortunately this library had some backwards-incompatible API changes, so when we ran Z, it crashed.
Copy code
kotlin.native.internal.IrLinkageError: Constructor 'Extended.<init>' can not be called: No constructor found for symbol 
        'co.touchlab.sqliter/DatabaseConfiguration.Extended.<init>|<init>(kotlin.Boolean;kotlin.Int;kotlin.Int?;kotlin.String?;co.touchlab.sqliter.SynchronousFlag?;kotlin.Boolean){}[0]'
    at 0   kfun:kotlin.native.internal#ThrowIrLinkageError(kotlin.String?){}kotlin.Nothing + 99 
    at 1   kfun:app.cash.zipline.loader.internal.cache.SqlDriverFactory#create(okio.Path;com.squareup.sqldelight.db.SqlDriver.Schema){}com.squareup.sqldelight.db.SqlDriver + 479
The fix is already done; we upgraded Z to the new version. Are there any tools or options to detect potential
IrLinkageError
crashes at build time? I’d love to fail the build if any used function is not declared!
r

russhwolf

11/20/2023, 7:28 PM
Check if
-Xpartial-linkage-loglevel=ERROR
helps, as described in https://kotlinlang.org/docs/whatsnew19.html#library-linkage-in-kotlin-native
👍 1
j

jessewilson

11/20/2023, 7:49 PM
Whoa, that’s perfect
👍 2
3 Views