bpo-45774: Autoconfiscate SQLite detection (GH-29507) by erlend-aasland · Pull Request #29507 · python/cpython
SQLite was not detected on buildbot
AMD64 FreeBSD Shared PR.@koobs where is sqlite installed on your FreeBSD buildbot? Is it in /usr/local by any chance? Would the solution https://bugs.python.org/issue45774#msg406076 work for FreeBSD?
sqlite3-3.35.5 is installed on both FreeBSD buildbot workers in LOCALBASE (/usr/local by default). This is the standard location for third party libraries installed via FreeBSD ports and official packages.
I haven't deeply reviewed the implementation in issue 45774, but I don't see a reference to --with(out)-sqlite3 to explicitly disable/enable, but otherwise and generally speaking, standard autoconf/configure checks for dependencies is fine.
I would also caution that wherever possible when doing dependency detection and configuration, we should include the ability to pass dependency specific include/library paths and *FLAGS, because Pythons build system is particularly inconsistent and flaky with respect to passing *FLAGS globally, which downstreams often have to utilise.
This can causes include ordering issues, as well as build/link time conflicts when a dependency is installed in more than one location, and both are picked up.
Other than at the configure level --with-foo-{inc,lib}=<path> (or similar), this also means Modules/Setup, if support for it is not there already (like SSL).
Further Sqlite3 Information
Installed libraries and header names:
# ls -la /usr/local/lib/libsqlite3.so*
lrwxr-xr-x 1 root wheel 19 Oct 30 01:09 /usr/local/lib/libsqlite3.so@ -> libsqlite3.so.0.8.6
lrwxr-xr-x 1 root wheel 19 Oct 30 01:09 /usr/local/lib/libsqlite3.so.0@ -> libsqlite3.so.0.8.6
-rwxr-xr-x 1 root wheel 1422160 Oct 30 01:09 /usr/local/lib/libsqlite3.so.0.8.6*
# ls -la /usr/local/include/sql*
-rw-r--r-- 1 root wheel 838 Oct 4 08:15 /usr/local/include/sql3types.h
-rw-r--r-- 1 root wheel 1283 Oct 4 08:15 /usr/local/include/sqlca.h
-rw-r--r-- 1 root wheel 1586 Oct 4 08:15 /usr/local/include/sqlda-compat.h
-rw-r--r-- 1 root wheel 824 Oct 4 08:15 /usr/local/include/sqlda-native.h
-rw-r--r-- 1 root wheel 321 Oct 4 08:15 /usr/local/include/sqlda.h
-rw-r--r-- 1 root wheel 584223 Oct 30 01:09 /usr/local/include/sqlite3.h
-rw-r--r-- 1 root wheel 35437 Oct 30 01:09 /usr/local/include/sqlite3ext.h
sqlite also installed a pkg-config file:
# pkgconf --list-all |grep sql
# sqlite3 SQLite - SQL database engine
# pkgconf sqlite3 --cflags --libs
# -I/usr/local/include -L/usr/local/lib -lsqlite3