Open JulianBissekkou opened 1 week ago
I am pretty new to kmp, so I might be wrong here but I assume that the sqlite3 library on the mac is somehow "outdated" and does not contain the symbols.
I assume that the libary that is linked is a system library stored at /System/Library/Tcl/sqlite3/libtclsqlite3.dylib
.
When I try to search for the first missing symbol I get no result:
nm /System/Library/Tcl/sqlite3/libtclsqlite3.dylib | grep load_extension
However, when I do the same with sqllite installed by homebrew I get some results:
nm /opt/homebrew/Cellar/sqlite/3.42.0/lib/libsqlite3.dylib | grep load_extension
00000000000116b4 T _sqlite3_enable_load_extension
000000000001122c T _sqlite3_load_extension
Does anybody maybe know a workaround? This issue is currently blocking for us.
I haven't built a macos app with sqldelight personally (I wrote most of the driver, or at least the original version). The tests run fine with -lsqlite3
without specifying the library search path, so I assume it's using a sqlite3 library from Xcode tools. libtclsqlite3
kind of seems like it's specific to tcl, but I've never used it. I would guess you'll need to include your own sqlite implementation.
Since you're building with Xcode, the easy solution would probably be to grab and build sqlite source directly in Xcode, and drop -lsqlite3
. To do that just for iOS, I assume you'll need some target slight-of-hand in Xcode config.
I compiled the sql lib from the mentioned sources and added the dylib file to the project. It was able to find some symbols but still failed to compile since some of them are unknown. Since I am building just a small POC i want to keep things simple. I was wondering if anything else is configued on my side. Is there an example project with a macOS app that I can try out and compare?
@kpgalligan If you run the tests are you compiling an MacosArm64 binary?
SQLDelight Version
2.0.2
Operating System
Mac OS 14.3.1
Gradle Version
Gradle 8.7 Revision: 650af14d7653aa949fce5e886e685efc9cf97c10
Kotlin Version
1.9.23
Dialect
SQLite
AGP Version
No response
Describe the Bug
I have an iOS App that is supports macOS.
After the build failed I added the linker flag
-lsqlite3
on iOS I am able to run the App and everything works as expected, however, on macOS the build fails.
Stacktrace