touchlab / SQLiter

Minimal multiplatform sqlite library
https://touchlab.co
177 stars 35 forks source link

SQLiter - 1.8 Beta Testing #88

Closed KatieGalvin closed 1 year ago

KatieGalvin commented 1 year ago

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:

samhill303 commented 1 year ago

Test RC version, not beta now that it's out

hfhbd commented 1 year ago

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?

kpgalligan commented 1 year ago

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 :)

hfhbd commented 1 year ago

@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

kpgalligan commented 1 year ago

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.

hfhbd commented 1 year ago

You are right, this syntax works and is nicer, thanks.