Closed KatieGalvin closed 1 year ago
Test RC version, not beta now that it's out
1.8.0 is out and I get some problems updating sqldelight to 1.8.0 with the native driver (https://github.com/cashapp/sqldelight/pull/3752):
> Task :drivers:native-driver:linkDebugTestIosX64
e: /Applications/Xcode_14.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld invocation reported errors
The /Applications/Xcode_14.0.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld command returned non-zero exit code: 1.
> Task :drivers:native-driver:linkDebugTestIosX64 FAILED
output:
Undefined symbols for architecture x86_64:
"_sqlite3_bind_blob", referenced from:
_co_touchlab_sqliter_sqlite3_sqlite3_bind_blob_wrapper69 in result.o
Would downgrading Xcode help as a workaround?
Kotlin 1.8 changes how linker flags are applied. The Sqldelight plugin used to silently add -lsqlite3
, but now that probably doesn't carry over. You'll need to add that to your Kotlin config directly or Xcode "Other Linker Flags".
For now, to apply this in Kotlin, use the following:
cocoapods {
framework {
linkerOpts("-lsqlite3") //<-- Add this
}
}
If not using CocoaPods, something like the following:
kotlin {
ios {
binaries.framework {
linkerOpts("-lsqlite3") //<-- Add this
}
}
}
This is also a change for SqlDelight, but frankly, I think we were all surprised 1.8 got released on New Years week :)
@kpgalligan I think, I got a workaround based on #90, at least for sqldelight (https://github.com/cashapp/sqldelight/pull/3752/commits/1810a86a3bfddac96d76b8f51e98315b376ac573). I am waiting for the CI, but locally it works. And yeah, Jetbrains can say Kotlin 1.8 was released in 2022 :D
I think you could simplify that a bit:
binaries.configureEach {
linkerOpts += ["-lsqlite3"]
}
But I'd have to break out the sqldelight to try it out, and I'm not doing a lot of Groovy config these days to know if that syntax would work without trying it.
You are right, this syntax works and is nicer, thanks.
Perform the list of sanity checks on your work projects (it mostly consists of basic actions).
Pay additional attention to these features and subsystems if applicable to your use case: