jessewilson
11/20/2023, 7:22 PMIrLinkageError
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.
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!russhwolf
11/20/2023, 7:28 PM-Xpartial-linkage-loglevel=ERROR
helps, as described in https://kotlinlang.org/docs/whatsnew19.html#library-linkage-in-kotlin-nativejessewilson
11/20/2023, 7:49 PM