-
-
Notifications
You must be signed in to change notification settings - Fork 731
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow building GRDBCipher with SwiftPM #556
Conversation
Hello @hartbit, you were fast :-)
This is my biggest concern. That's a big new 7Mb file. Shouldn't we export the amalgamation Package in its own repository? For example, GRDB supports custom SQLite builds by depending on http://github.com/swiftlyfalling/SQLiteLib. This is a nice separation of concerns. I also hope that it makes clear that this is not a regular PR. This one isn't free! Someone will have to maintain SQLCipher, embedded here, or in a GRDB fork, or in its own external repository. Your position on this would be welcome.
GRDB still claims support for Swift 4.2 (and tests it). Thanks to Version-specific manifest selection, we can keep the previous Package.swift file, renamed to EDIT: if Swift 4.2 does not support version-specific manifests, then we'll force SPM users to Swift 5. This will be a breaking change, but one I'll be able to live with. I just wish we could avoid it if possible.
You've done your best effort 😅 |
Do you want to create the repo for SQLCipher? I can send a PR to that repo with everything to have a working Swift Package for SQLCipher.
I know :-( What I can do is create a script in the SQLCipher repo to simplify the process of fetching a specific version of SQLCipher, amalgamating it, and creating a new tagged version. This will at least make the process easy enough that we will be more inclined to keep it up to date.
I'll do that change.
I'll send a PR to SwiftPM to support an |
Hi again @hartbit, I've been busy shipping v4.1 so I could not address your last message. And I'll postpone my answer again, because I'm leaving in vacations. So let's put on hold this topic for a few weeks. I hope you are not blocked, and that your own explorations run smoothly! |
Hi @groue. No rush! Have a great vacation 🏝 |
Back from vacations, but still postponing a bit. I can't help but thinking we're fighting with SPM. Nah, I'm preparing v4.2, so I'm all in my "strict phase". I'll soon be more open to experiments. |
We'll be fighting SPM until it supports running pre-build scripts, which we need for the amalgamation step. I'm just putting myself in the shoes of a GRDB user, where SPM in Xcode is now the easiest way to get started: It'd be a pity if the user had to abandon SPM and migrate to Cocoapods when they need to encrypt their database. |
Yes, David, you are totally right. Consider me sold. |
Hello @hartbit! After a few weeks of vacations, and the release of v4.2, I'm ready to keep on discussing with you and find a way forward :-) Let's start with a summary of our previous conversations:
Let me propose the draft of a plan, and tell me how it sounds to your ears. I'll not make any assumption about who does what, because it's all too early yet. Scheduling and ETA are also out of scope.
Does it sound like a correct direction to you? My wish is that nothing would prevent you from jumping on the board, for the duration you want. I need you, here. |
I've been on vacation the last few weeks. I'll reply ASAP. |
Closing due to lack of activity |
Hello, I was wondering what is the status of this issue? |
Hello @jcavar. No, there isn't any recommended way to install GRDB + SQLCipher with SPM. It's up to you to build up a solution. If you do so, please share the results of your work! |
Since @groue suggested we should share the results of our work if we have a solution, I'll share my makeshift one for using SQLCipher with GRDB installed via SPM. You can build an amalgamation yourself (using the instructions at https://www.zetetic.net/sqlcipher/ios-tutorial/) and fork and modify GRDB to use it instead of CSQLite (as seen at metabolist@ea3ed26). I would recommend doing this yourself and not using my fork as I may modify or delete it without notice. I've opened an issue with SQLCipher asking if they'd be open to maintaining an official SPM package so this would not be necessary in the future. |
Pull Request Checklist
development
branch.Changes
Package.swift
manifest:SQLCipher
target, a newGRDBCipher
target that depends on it, and aGRDBCipher
product that makes it available.swift-tools-version
version to5.0
to allow specifying compiler defines necessary for building SQLCipher and for building GRDB withSQLITE_HAS_CODEC
.GRDBCipher
folder that symlinks toGRDB
to avoid a current SwiftPM issue (https://bugs.swift.org/browse/SR-10974).import Foundation
statements inFTS5.swift
,FTS5Tokenizer.swif
, andFTS5WrapperTokenizer.swift
which were missing but necessary.Issues
The are two remaining issues:
configuration necessary to silence the warnings makes is not supported in Xcode (perhaps for security reasons).
I opened a SwiftPM issue regarding this: https://bugs.swift.org/browse/SR-10978