You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detect header/library using AC_CHECK_HEADERS/AC_CHECK_LIB
Check required version using AC_COMPILE_IFELSE
Use AC_CHECK_LIB to check if sqlite3_load_extension is present, and if the result harmonises with --enable-loadable-sqlite-extensions; bail if not
Nice side effect: configure will bail if --enable-loadable-sqlite-extensions is used and the target SQLite library was compiled with SQLITE_OMIT_LOAD_EXTENSION, even if we are not on macOS.
I saw your message concerning sqlite3 on the FreeBSD buildbot. It's hard to tell why configure on FreeBSD doesn't find sqlite3.h without access to config.log or a shell. Maybe sqlite3 is installed in /usr/local ? configure does not use /usr/local/include and /usr/local/lib by default. setup.py extends the search paths for headers and libraries by non-standard locations.
Reopening: the current detection is a little bit weak; many SQLite API's may be disabled at SQLite compile time using SQLITE_OMIT_* defines. We must make sure we've got all vital functions in place before marking the sqlite3 module as present and usable.
The following API's can be omitted using compile time defines:
Activity
erlend-aasland commentedon Nov 9, 2021
"Autoconfiscate" SQLite detection. Plan:
Nice side effect: configure will bail if --enable-loadable-sqlite-extensions is used and the target SQLite library was compiled with SQLITE_OMIT_LOAD_EXTENSION, even if we are not on macOS.
tiran commentedon Nov 9, 2021
Your solution looks very similar to my WIP patch:
AC_CHECK_HEADERS([sqlite3.h],
[AC_SEARCH_LIBS([sqlite3_version], [sqlite3])]
)
LIBS=$LIBS_SAVE
AS_VAR_IF([ac_cv_lib_sqlite3_supported], [yes],
[AC_DEFINE([HAVE_LIBSQLITE3], [1], [Define to 1 if you have the `sqlite3' library (-lsqlite3).])]
)
AS_VAR_IF([ac_cv_lib_sqlite3_sqlite3_enable_load_extension], [yes],
[AC_DEFINE([HAVE_SQLITE3_ENABLE_LOAD_EXTENSION], [1],
[Define to 1 if `sqlite3' library supports sqlite3_enable_load_extension.])]
)
erlend-aasland commentedon Nov 9, 2021
Nice. I think I'll steal some of your ideas tomorrow :)
tiran commentedon Nov 10, 2021
I saw your message concerning sqlite3 on the FreeBSD buildbot. It's hard to tell why configure on FreeBSD doesn't find sqlite3.h without access to config.log or a shell. Maybe sqlite3 is installed in /usr/local ?
configuredoes not use /usr/local/include and /usr/local/lib by default.setup.pyextends the search paths for headers and libraries by non-standard locations.A "config.site" file should do the trick:
tiran commentedon Nov 19, 2021
New changeset 29e5874 by Erlend Egeberg Aasland in branch 'main':
bpo-45774: Autoconfiscate SQLite detection (GH-29507)
29e5874
tiran commentedon Nov 19, 2021
Awesome work! Thanks to your tireless effort we know have a blue print how to use pkg-config for other librariess.
erlend-aasland commentedon Nov 20, 2021
Needs amendment before closing. See #73845.
erlend-aasland commentedon Nov 20, 2021
Thank you for reviewing, and thank you for paving the way with all these build system improvements :)
tiran commentedon Nov 20, 2021
New changeset 6d430ef by Erlend Egeberg Aasland in branch 'main':
bpo-45774: Fix SQLite load extension autodetection (GH-29659)
6d430ef
erlend-aasland commentedon Dec 9, 2021
Reopening: the current detection is a little bit weak; many SQLite API's may be disabled at SQLite compile time using SQLITE_OMIT_* defines. We must make sure we've got all vital functions in place before marking the sqlite3 module as present and usable.
The following API's can be omitted using compile time defines:
The following API's _may_ be disabled in the future using SQLITE_OMIT_FLOATING_POINT:
tiran commentedon Apr 5, 2022
New changeset f1606a5 by Erlend Egeberg Aasland in branch 'main':
bpo-45774: Harden SQLite detection (GH-30016)
f1606a5