fix(c/driver/sqlite): detect sqlite3_load_extension via compile check#4471
Merged
lidavidm merged 2 commits intoJul 9, 2026
Merged
Conversation
The build detected sqlite3_load_extension() availability with a plain-text search of sqlite3.h. That heuristic is unreliable: the identifier also appears in comments and inside blocks guarded by SQLITE_OMIT_LOAD_EXTENSION, so the symbol can be textually present in the header yet not actually declared/linkable. Apple's system SQLite is built with load extension omitted, so the search matched but sqlite.cc then failed to compile with "use of undeclared identifier 'sqlite3_load_extension'". This started failing when the macos-latest (Apple Silicon) CI runner image was rolled to one whose SQLite omits the function; the string search never detected the omission. Replace it with a real compile+link probe using CheckSymbolExists, matching how the R package's configure script already detects the same thing. Signed-off-by: Fredrik Fornwall <fredrik@fornwall.net>
c78ba3d to
4d8ee68
Compare
Contributor
Author
955f76a to
a7e4e07
Compare
Contributor
Author
|
There seems to be some hang? Not sure what that is about, or if it's caused by this PR, or some problems with new gitlab runners (seems to be specific to those). |
lidavidm
approved these changes
Jul 8, 2026
lidavidm
left a comment
Member
There was a problem hiding this comment.
Thanks for the fix, just one question
Handle the vcpkg branch and older cmake distributions.
a7e4e07 to
e72b469
Compare
lidavidm
approved these changes
Jul 8, 2026
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.
The build detected
sqlite3_load_extension()availability with a plain-text search ofsqlite3.h. That heuristic is unreliable: the identifier also appears in comments and inside blocks guarded bySQLITE_OMIT_LOAD_EXTENSION, so the symbol can be textually present in the header yet not actually declared/linkable. Apple's system SQLite is built with load extension omitted, so the search matched butsqlite.ccthen failed to compile with "use of undeclared identifier 'sqlite3_load_extension'".This started failing when the macos-latest (Apple Silicon) CI runner image was rolled to one whose SQLite omits the function; the string search never detected the omission. Replace it with a real compile+link probe using CheckSymbolExists, matching how the R package's configure script already detects the same thing.
Closes #4470.