Link core extension statically#344
Merged
Merged
Conversation
simolus3
commented
Apr 28, 2026
stevensJourney
approved these changes
Apr 30, 2026
stevensJourney
left a comment
Contributor
There was a problem hiding this comment.
The changes here look good to me. This makes the setup steps much simpler for users. I can't think of any negative repercussions for these changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, we don't link the core extension at all on native platforms. Instead:
Following this setup is annoying and error-prone for users, since they have to manage this dependency outside of Gradle and remember to update it every time they upgrade the Kotlin SDK.
This fixes the issue by linking the core extension statically: The
:corepackage uses a cinterop definition with a downloaded static library attached to core extension releases. This embeds the core extension with the built klib, and users don't have to rely on external dependenies anymore. Additionally, it simplifies our loading setup: Previously, we had to usesqlite3_load_extensionwith a resolved framework path. With static linking, we can simply callsqlite3_auto_extensionwith thesqlite3_powersync_initfunction pointer to load the extension.I've tested the demo app in a simulator and a local framework build for the Swift SDK (that currently causes additional test failures there because Kotlin doesn't support the old sync client anymore, but we're able to load the extension).
Closes #339.