-
-
Notifications
You must be signed in to change notification settings - Fork 722
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
Move sqlcipher.xcodeproj targets into GRDBCipher.xcodeproj #481
Conversation
Proof of concept related to: groue#480 Not working: - Various failing tests with getting back `SQLITE_ERROR` instead of `SQLITE_MISUSE`. Not sure about this.. - Doesn't work with new Xcode build system. Since the `sqlcipher-amalgamation` target builds `sqlite3.c`, I don't think the new build system knows about this, so it fails the build of the `sqlcipher-ios` target immediately say that "sqlite3.c is missing" Might need to use a custom run script build phase that explicitly sets the outputs.
Thank you @darrenclark for this exploration! Your help is very welcome. It would be great to turn this proof of concept into a shippable product:
Phew! Let's see how far we can go ;-) Let's start from your questions.
Yes, I think target outputs are a good way to instruct the new build system about dependencies.
Maybe the explicit target output will clean it?
The screenshot tests that iterating a GRDB cursor after its first error keeps on outputting an error. This is important because if it were not the case, this would be a big breaking change. The canonical cursor iteration code relies on the fact that the first cursor error is fatal: // The canonical cursor iteration code
do {
while let value = try cursor.next() {
// Handle value
}
} catch {
// Cursor is dead
} This GRDB contract currently relies on the raw SQLite behavior. The failing test shows that SQLite has changed: sqlite3_next() now returns SQLITE_MISUSE after sqlite3_next() has previously returned an error. This is still OK: we'll just have to change the test (any error after the first error should be enough for the test to pass). |
Hello again @darrenclark, do you feel like pushing this proof of concept up to the mergeable pull request? |
Hey @groue, sure, it’s been a hectic couple weeks for me so I haven’t had much time. I’ll try to take a look at it this weekend |
That would be great! |
This is still on my radar, things have been a little chaotic over the last couple days and haven't had a chance to look into it yet |
Don't worry :-) The GRDB-4.0 backlog #479 is slowly progressing on my side too, and we don't have to rush. |
1. Now uses a shell script build phase (rather than external build system target) 2. Does the `configure` + `make` in a different (.gitignore-ed) directory so it doesn't show up as changes in git
Got a little further on this. Now working with the new build system & building for Mac now too. TODO:
|
Thanks @darrenclark!
Yes. As I said above: any error after the first error should be enough for the test to pass. This is enough to validate the Cursor intent.
The Makefile already contains tests. You may not have to update them:
|
About tests: You can run them locally, on your mac, with You can activate more tests with Travis: just click on the "Ready for review" button. |
Now compiling with SQLITE_OMIT_AUTORESET defined. Enabling this ensures error return values consistent with Apple's sqlite3 for sqlite3_step
@groue I think this is ready. I wasn't able to run the full suite locally, have some Xcode / Cocoapods configuration issues at the moment. Will keep an eye on TravisCI. After digging into the failing tests a little more, I noticed it was a compiler flag causing the (https://www.sqlite.org/compile.html#omit_autoreset). It seems SQLiteCustom is also compiled with this
|
Travis support for Github is not extended yet to the new "draft PR": hitting the "Ready for review" button (I see it), and turning this draft PR into a real one did not trigger Travis checks. OK, I'll check that in the few next hours. |
@groue I can just re-open the PR if you want? |
Hello @darrenclark, I've just pushed an empty commit, and this was enough to trigger the Travis hook :-) Meanwhile, here is some news on the GRDB 4 front: The GRDB-4.0 branch has been updated with the recent changes brought by 3.7.0: you may want to merge this branch into yours. In the way, you'll see that the |
@darrenclark, I haven't heard from you for a while now. This is not a problem. But I now assume you will not complete this PR. I'd be happy if you keep your https://github.com/darrenclark/GRDB.swift/tree/GRDB-4.0-sqlcipher branch available, should anyone use it as a base for a tight integration of SQLCipher in GRDB 4. Thanks for pushing this topic forward! cc @Marus, @michaelkirk-signal, for information. |
Hey @groue, apologies, things have been quite busy the last few weeks. Will leave the branch up! I'm not a user of SQLCipher, but will leave it up in case anyone wants to push this PR forward |
Proof of concept related to: #480
Essentially just brings the
sqlcipher.xcodeproj
targets intoGRDBCipher.xcodeproj
Not working
Doesn't work with new Xcode build system. Since the
sqlcipher-amalgamation
target buildssqlite3.c
, I don't think the new build system knows about this, so it fails the build immediately saying "sqlite3.c is missing"Might need to use a custom run script build phase that explicitly specifies
sqlite3.c
as an outputVarious failing tests with getting back
SQLITE_ERROR
instead ofSQLITE_MISUSE
. Not sure about this.Doing a "clean" in xcode doesn't clean
sqlite3.c
yet