Skip to content

Conversation

@simolus3
Copy link
Collaborator

@simolus3 simolus3 commented Jan 9, 2026

This adds the Encryption package trait to our CSQLite fork. When enabled, we'll compile SQLite3MultipleCiphers instead of SQLite.

This is a horrible hack to work around XCode not supporting package traits. We can't enable package traits in our Swift SDK for that reason, but we can ask users interested in encryption to add a direct dependency on CSQLite from their project and enable the Encryption trait. Because a Swift build only compiles a given package once, this essentially hacks our Swift SDK to also depend on the Encryption trait, causing sqlite3mc to get linked.

This also means that we'll just have a single target now. To conditionally include SQLite vs. SQLite3MultipleCiphers, I've added entry headers and C files that include either library depending on whether the package trait is enabled. Given how unreliable all of this sounds, we'll only really know if this works when it's released. But I managed to get encryption working with this approach and local dependencies.

Copy link

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a clever solution to a horrible problem. I hope XCode supports package traits soon - I'm happy with this as a work around.

@simolus3 simolus3 merged commit 49dc1d1 into main Jan 9, 2026
1 check passed
@simolus3 simolus3 deleted the encryption branch January 9, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants