Repository navigation
Keep sqlite3ext.h and sqlite-vec.h out of the public CSQLiteVec module - #13
Open
laurentbigsool wants to merge 1 commit into
Open
laurentbigsool wants to merge 1 commit into
laurentbigsool wants to merge 1 commit into
Conversation
The bundled sqlite3ext.h defines sqlite3_api_routines for the bundled SQLite.
When an app also imports the SDK's SQLite3 module, whose sqlite3ext.h comes
from a different SQLite version, Clang rejects the two definitions of the
struct ("has different definitions in different modules"). Xcode 27.1 ships
SQLite 3.54.0 against the bundled 3.51.0, so any target importing both fails.
The Swift wrapper only needs extinit.h, and sqlite-vec.c and extinit.c include
these headers with quotes, so they now sit next to the sources instead of in
include/. deps.sh copies them there too.
Co-Authored-By: Claude <noreply@anthropic.com>
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.
Problem
CSQLiteVecexposes the bundledsqlite3ext.hin its publicinclude/directory. When a target also imports the SDK'sSQLite3module (directly, or through an Objective-C header in a bridging header), Clang sees two definitions ofsqlite3_api_routinesand fails as soon as the SDK's SQLite differs from the bundled one:Xcode 27.1 ships SQLite 3.54.0, which added
str_truncateto the struct, against the bundled 3.51.0. #11 hit the same problem with an earlier SDK; bumping the amalgamation fixes it only until the next SDK update.Change
sqlite3ext.handsqlite-vec.hfromSources/CSQLiteVec/include/toSources/CSQLiteVec/. The Swift wrapper only usescore_vec_initfromextinit.h, andsqlite-vec.c/extinit.cinclude these headers with quotes, so they resolve next to the sources.deps.shcopies them to the new location.The public module now contains only
sqlite3.handextinit.h, so it no longer conflicts with the SDK'sSQLite3.Ext, whatever the SDK SQLite version.Testing
swift test: 14 tests pass.SQLite3(via its bridging header) andSQLiteVecbuilds again with Xcode 27.1, and its SQLiteVec-based tests pass on the simulator.Related: #11