Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure: --with-dbmliborder=gdbm no longer satisfies _dbm #98636

Closed
mgorny opened this issue Oct 25, 2022 · 1 comment
Closed

configure: --with-dbmliborder=gdbm no longer satisfies _dbm #98636

mgorny opened this issue Oct 25, 2022 · 1 comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@mgorny
Copy link
Contributor

mgorny commented Oct 25, 2022

Bug report

It seems that the configure script is no longer able to build _dbm module from gdbm_compat.

Excerpts from configure log (full log: configure.txt):

$ ./configure -C --with-dbmliborder=gdbm
[...]
checking gdbm.h usability... yes
checking gdbm.h presence... yes
checking for gdbm.h... yes
checking for gdbm_open in -lgdbm... yes
checking ndbm.h usability... no
checking ndbm.h presence... no
checking for ndbm.h... no
checking for ndbm presence and linker args...  ()
checking gdbm/ndbm.h usability... yes
checking gdbm/ndbm.h presence... yes
checking for gdbm/ndbm.h... yes
checking gdbm-ndbm.h usability... no
checking gdbm-ndbm.h presence... no
checking for gdbm-ndbm.h... no
checking for library containing dbm_open... -lgdbm_compat
checking db.h usability... no
checking db.h presence... no
checking for db.h... no
checking for --with-dbmliborder... gdbm
checking for _dbm module CFLAGS and LIBS...  
[...]
checking for stdlib extension module _dbm... missing
checking for stdlib extension module _gdbm... yes
[...]

It seems that the problem is in the following snippet:

for db in $with_dbmliborder; do
  case "$db" in
    ndbm)
      if test "$have_ndbm" = yes; then
        DBM_CFLAGS="-DUSE_NDBM"
        DBM_LIBS="$dbm_ndbm"
        have_dbm=yes
        break
      fi
      ;;
    gdbm)
      if test "$have_gdbm_compat" = yes; then
        DBM_CFLAGS="-DUSE_GDBM_COMPAT"
        DBM_LIBS="-lgdbm_compat"
        have_dbm=yes
        break
      fi
      ;;

However, have_gdbm_compat is not declared anymore, probably because of:

AC_MSG_CHECKING([for ndbm presence and linker args])
AS_CASE([$ac_cv_search_dbm_open],
  [*ndbm*|*gdbm_compat*], [
    dbm_ndbm="$ac_cv_search_dbm_open"
    have_ndbm=yes
  ],

declaring have_ndbm=yes in this case.

Seems to have been introduced in ec5e253 by @tiran.

Your environment

  • CPython versions tested on: 3.12.0a1
  • Operating system and architecture: Gentoo/amd64

Linked PRs

@mgorny mgorny added the type-bug An unexpected behavior, bug, or error label Oct 25, 2022
@AlexWaygood AlexWaygood added the build The build process and cross-build label Oct 25, 2022
@mgorny
Copy link
Contributor Author

mgorny commented Oct 25, 2022

I'll file a PR in a minute.

mgorny added a commit to mgorny/cpython that referenced this issue Oct 25, 2022
Fix the gdbm_compat library detection logic to set have_gdbm_compat=yes,
as expected by `--with-dbmliborder=` handler.  This fixes the build
failure with `--with-dbmliborder=gdbm`, and implicit fallback to ndbm
with the default value.
mgorny added a commit to mgorny/cpython that referenced this issue Oct 25, 2022
Fix the gdbm_compat library detection logic to actually check for
-lgdbm_compat independently of the ndbm detection.  This fixes the build
failure with `--with-dbmliborder=gdbm`, and implicit fallback to ndbm
with the default value.
mgorny added a commit to mgorny/cpython that referenced this issue Oct 25, 2022
Fix the gdbm_compat library detection logic to actually check for
-lgdbm_compat independently of the ndbm detection.  This fixes the build
failure with `--with-dbmliborder=gdbm`, and implicit fallback to ndbm
with the default value.
mgorny added a commit to mgorny/cpython that referenced this issue Dec 18, 2022
Fix the gdbm_compat library detection logic to actually check for
-lgdbm_compat independently of the ndbm detection.  This fixes the build
failure with `--with-dbmliborder=gdbm`, and implicit fallback to ndbm
with the default value.
mgorny added a commit to mgorny/cpython that referenced this issue Dec 31, 2022
Fix the gdbm_compat library detection logic to actually check for
-lgdbm_compat independently of the ndbm detection.  This fixes the build
failure with `--with-dbmliborder=gdbm`, and implicit fallback to ndbm
with the default value.
erlend-aasland pushed a commit that referenced this issue Jan 11, 2023
Fix the gdbm_compat library detection logic to actually check for
-lgdbm_compat independently of the ndbm detection.
This fixes the build failure with `--with-dbmliborder=gdbm`,
and implicit fallback to ndbm with the default value.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants