Repository navigation
iOS SQLite compiled with exqlite's defines, so FTS5 works on device (MOB-487) - #143
Merged
Merged
Conversation
…MOB-487) The iOS simulator NIF, the iOS device sqlite3_nif.a and mix mob.release --ios compiled exqlite's SQLite amalgamation with only -DSQLITE_THREADSAFE=1, so FTS5 and exqlite's other features were missing on the phone. They now use MobDev.Exqlite.cflags/0: exqlite's Makefile defines, verbatim. MobDev.ExqliteTest pins the list against the locked exqlite's Makefile (exqlite added as a test-only, never-compiled dep) and against mob_new's Android templates.
An installed mob_new archive or a stale ~/code/mob_new (templates_root/1's other sources) can predate the define list (review).
Owner
Author
|
Review: reviewer subagent (Codex rate-limited until 17:26 today): MERGE. First pass: one should-fix (ExqliteTest read mob_new templates through templates_root/1, which can hit an installed archive or stale ~/code/mob_new) and one nitpick (test-only exqlite dep pulls db_connection); both addressed in f5912ba. Re-review: MERGE, no findings. Companion GenericJam/mob_new#104 merged first; CI tests green on f5912ba (run 38808121786, 3036 tests, 0 failures, sync test ran against mob_new master). |
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.
Fixes MOB-487 (iOS half and the single definition; Android templates in GenericJam/mob_new#104, which must merge first: this PR's sync test reads mob_new master's templates in CI).
mob compiled exqlite's SQLite amalgamation with only
-DSQLITE_THREADSAFE=1, so on the phone SQLite had no FTS5 (no such module: fts5) and none of exqlite's other features, while the host NIF (exqlite's Makefile) had them.MobDev.Exqlite.defines/0/cflags/0: exqlite's MakefileCFLAGS += -D…lines, verbatim and in order. The one definition for every mob_dev build of the NIF:sqlite3_nif.so(cross_compile_exqlite_nif_sim)sqlite3_nif.a, both objects (cross_compile_exqlite_nif_device)mix mob.release --ios(release_device.sh,$SQLITE_CFLAGS)MobDev.ExqliteTest: the set includes FTS5; equals the locked exqlite's Makefile set (exqlite added as a test-only dep withcompile: false, app: false: source only, never built or loaded); equals the list in mob_new's Androidbuild.zig.eexandCMakeLists.txt.eex(read viaMobDev.Adopt.Generator.templates_root/1, as the -dead_strip test does).Verified with a throwaway
mix mob.new --blank --localapp (path deps on these worktrees) whose screen runsCREATE VIRTUAL TABLE t USING fts5(x), an INSERT and aMATCHthrough Exqlite:FTS5 ERROR "no such module: fts5"FTS5 OK rows=[["in the beginning"]]FTS5 ERROR "no such module: fts5"FTS5 OK rows=[["in the beginning"]]iOS device path (no physical iPhone): compiled
sqlite3.cwith the iphoneos SDK andMobDev.Exqlite.cflags()exactly ascross_compile_exqlite_nif_devicedoes; the object carries the FTS5 module (345 fts5 symbols,sqlite3RtreeInit).release_device.shpassesbash -nand both exqlite compiles use$SQLITE_CFLAGS.Note: the set includes
SQLITE_DQS=0, so the device, like the host, rejects double-quoted string literals.