This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Detect dbm and gdbm dependencies in configure.ac
Type: enhancement Stage: resolved
Components: Build Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: arhadthedev, christian.heimes, erlendaasland, pablogsal, ronaldoussoren
Priority: normal Keywords: patch

Created on 2021-11-08 10:27 by christian.heimes, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 29467 merged christian.heimes, 2021-11-08 10:34
PR 32299 open arhadthedev, 2022-04-04 08:29
Messages (6)
msg405940 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-08 10:27
setup.py jumps through hoops to detect gdbm, gdbm_compat, ndbm, and bdb (libdb) build dependencies. I propose to simplify our support matrix and detect all dependencies in configure.ac.

gdbmmodule.c uses gdbm_open() API, which is provided by gdbm.h and libgdbm

dbmmodule.c uses the dbm_open() API, which can be provided by a combination of headers and shared libraries.

- gdbm/ndbm.h with libgdbm_compat
- gdbm-ndbm.h with libgdbm_compat
- ndbm.h with libgdbm_compat
- ndbm.h with libndbm
- db.h with libdb (lib-5.3 for over a decade)

setup.py makes some wrong assumption in regards of libgdbm. The shared library libgdbm does not provide the dbm_open() API on any system I tested. libgdbm_compat is always required. Linking with libgdbm is not needed. libgdbm_compat depends on and wraps libgdbm.

setup.py also performs additional steps to locate old versions of libdb-3.x and libdb-4.x. libdb-5.3 has been around for a decade. Even CentOS 7 and Debian oldoldstable ship with libdb version 5.3 and don't offer libdb version 4. I propose to remove support for libdb 4 and libdb 3.
msg405941 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-08 10:58
Pablo's macOS ARM64 buildbot does not find libdb-5.3 although it has db.h: https://buildbot.python.org/all/#/builders/721/builds/97/steps/2/logs/stdio

macOS X86-64 buildbot has libdb-5.3: https://buildbot.python.org/all/#/builders/311/builds/332/steps/2/logs/stdio
msg405946 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2021-11-08 13:02
dbm_open is in libc on macOS. likely due to being in SUSv2.

The implementation in libc appears to be suboptimal (for example: issue33074), although I wouldn't teach configure.ac to ignore the system version of the library.
msg405953 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-08 14:51
Thanks Ronald. I was not aware that macOS has dbm_open in libc.

AC_CHECK_LIB() always tries to link with an external library. The macro should skip the symbol from libc. Could you please run the PR locally and upload your config.log?
msg406053 - (view) Author: Erlend E. Aasland (erlendaasland) * (Python triager) Date: 2021-11-09 21:03
AC_SEARCH_LIBS() will search libc before checking external libraries, FWIW.
msg406127 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2021-11-10 19:27
New changeset 0a9f69539be27acf1cddf1b58d02a88d02e5008d by Christian Heimes in branch 'main':
bpo-45747: Detect gdbm/dbm dependencies in configure (GH-29467)
https://github.com/python/cpython/commit/0a9f69539be27acf1cddf1b58d02a88d02e5008d
History
Date User Action Args
2022-04-11 14:59:52adminsetgithub: 89910
2022-04-04 08:29:49arhadthedevsetnosy: + arhadthedev

pull_requests: + pull_request30359
2021-11-10 19:58:15christian.heimessetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-11-10 19:27:04christian.heimessetmessages: + msg406127
2021-11-09 21:03:34erlendaaslandsetnosy: + erlendaasland
messages: + msg406053
2021-11-08 14:51:30christian.heimessetmessages: + msg405953
2021-11-08 13:02:40ronaldoussorensetnosy: + ronaldoussoren
messages: + msg405946
2021-11-08 10:58:00christian.heimessetnosy: + pablogsal
messages: + msg405941
2021-11-08 10:34:21christian.heimessetkeywords: + patch
stage: patch review
pull_requests: + pull_request27720
2021-11-08 10:27:28christian.heimescreate