Currently, SQLDelight supports only Apple and Windows as native platform targets. If you want to use it in a project that also targets linux, then you can't even use it for other targets as the gradle plugin seems to attempt to math the native variant:
Execution failed for task ':cinteropSodiumLinux'.
> Could not resolve all files for configuration ':linuxSodiumCInterop'.
> Could not resolve com.squareup.sqldelight:runtime:1.4.0.
Required by:
project :
> Unable to find a matching variant of com.squareup.sqldelight:runtime:1.4.0:
- Variant 'iosArm32-api' capability com.squareup.sqldelight:runtime:1.4.0:
- Incompatible attribute:
- Required org.jetbrains.kotlin.native.target 'linux_x64' and found incompatible value 'ios_arm32'.
- Other attributes:
- Found org.gradle.status 'release' but wasn't required.
- Required org.gradle.usage 'kotlin-api' and found compatible value 'kotlin-api'.
- Required org.jetbrains.kotlin.platform.type 'native' and found compatible value 'native'.
- Variant 'iosArm64-api' capability com.squareup.sqldelight:runtime:1.4.0:
- Incompatible attribute:
- Required org.jetbrains.kotlin.native.target 'linux_x64' and found incompatible value 'ios_arm64'.
- Other attributes:
- Found org.gradle.status 'release' but wasn't required.
- Required org.gradle.usage 'kotlin-api' and found compatible value 'kotlin-api'.
- Required org.jetbrains.kotlin.platform.type 'native' and found compatible value 'native'.
and so on for all supported native variants.
The best fix would be to add the linuxX64 variant as well which probably hasn't happened because all developers are on Mac!?
Unfortunately, it seems that touchlab's SQLiter needs to add support first.
We would need to figure out sqliter. You are correct, that we're all on macs. We have a fairly bespoke build for sqliter, that is on the list to change anyway and use "standard" cinterop, which would make this easier, but I don't have a timeline currently.
Is there anything which can be done here or sqliter build is still a blocker?
Okay, yeah, I checked and sqliter doesn't have a Linux build and it has some hardcoded stuff from the developer machine and if you try to build it downloads the compiler and opens portal to hell so... I guess I leave it to someone who knows what to do there
@kpgalligan any updates? Would working within a docker container suffice for fleshing out sqliter on linuxX64?
I opened a PR on the SQLiter repo which adds support for linux targets.
Once that one (or something similar) is merged it actually should be pretty straight forward to add linux as a target here (the changes i needed to make on my local build were pretty minimal but maybe I don't see the full picture).
Depending on the outcome of said PR i could also file a PR here once it's merged. It depends on whether this is wanted with the current state of SQLiter (refering to the above comment of @kpgalligan) and you would welcome such a PR regardless of the state of SQLiter.
Please send a PR when the dependency is ready. We won't be able to have a passing build until all our dependencies are updated.
Most helpful comment
I opened a PR on the
SQLiterrepo which adds support for linux targets.Once that one (or something similar) is merged it actually should be pretty straight forward to add linux as a target here (the changes i needed to make on my local build were pretty minimal but maybe I don't see the full picture).
Depending on the outcome of said PR i could also file a PR here once it's merged. It depends on whether this is wanted with the current state of
SQLiter(refering to the above comment of @kpgalligan) and you would welcome such a PR regardless of the state ofSQLiter.