Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 383757 - dev-lang/python: dbm module requires || ( sys-libs/gdbm[berkdb] sys-libs/db )
Summary: dev-lang/python: dbm module requires || ( sys-libs/gdbm[berkdb] sys-libs/db )
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: http://docs.python.org/library/dbm.html
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 04:27 UTC by Alexandre Rostovtsev (RETIRED)
Modified: 2018-04-20 21:28 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-09-20 04:27:26 UTC
dev-lang/python (all versions) with USE=gdbm uses gdbm/ndbm.h in Modules/dbmmodule.c and links to libgdbm_compat. However, in gdbm-1.9.1 and higher, Berkeley db compatibility support is optional, and ndbm.h and libgdbm_compat are installed only when gdbm has the compat USE flag enabled.

Therefore, python's gdbm dependency should be changed to something like

gdbm? ( || ( <sys-libs/gdbm-1.9 sys-libs/gdbm[compat] ) )
Comment 1 Bernd Feige 2011-09-20 09:27:21 UTC
Thanks for the hint - compiling sys-libs/gdbm with USE=compat however results in the following build failure for dev-lang/python-2.7.2-r3 (USE=gdbm) here:
"*** WARNING: renaming "dbm" since importing it failed: /usr/lib/libgdbm_compat.so.4: undefined symbol: gdbm_errno"

So right now only masking >=sys-libs/gdbm-1.9 will allow compiling python with the dbm module?
Comment 2 Rafał Mużyło 2011-09-20 09:55:05 UTC
@comment 1: no, what you see is bug 383743, that's already fixed in the tree.

Actually, this new version seems to introduce a need for a split of the 'gdbm' useflag into two, as gdbm.so doesn't need libgdbm_compat, only dbm.so needs it.
Comment 3 Bernd Feige 2011-09-20 10:37:07 UTC
Thanks for the clarification. Sigh - I had considered the "dbm" module as a safe bet, being able to utilize whatever dbm implementation is functional on the system, just to find that dbm requires gdbm compatibility obscure enough for upstream to drop from default, while module gdbm proper works like a charm. And it's the same for dev-lang/python-3.2.2. Probably should go into wishlist for upstream python?
Comment 4 Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-09-20 16:26:23 UTC
(In reply to comment #2)
> @comment 1: no, what you see is bug 383743, that's already fixed in the tree.
> 
> Actually, this new version seems to introduce a need for a split of the 'gdbm'
> useflag into two, as gdbm.so doesn't need libgdbm_compat, only dbm.so needs it.

Why? I have always interpreted the gdbm USE flag as "use the sys-libs/gdbm backend for storage", and that's exactly what it does here - uses sys-libs/gdbm as the backend for python's dbm module.
Comment 5 Rafał Mużyło 2011-09-20 18:34:18 UTC
@comment 4: no, read the ebuild:
use berkdb   || use gdbm || disable+=" dbm"
use gdbm     || disable+=" gdbm"

line one needs libgdbm_compat, line two does not.
Comment 6 Alexandre Rostovtsev (RETIRED) gentoo-dev 2011-09-20 18:50:36 UTC
(In reply to comment #5)

I still don't understand why you think a new USE flag is needed. Currently, for the python ebuild, USE=gdbm means "build the gdbm and dbm modules; use sys-libs/gdbm as backend for dbm". Where is the problem with that?
Comment 7 Rafał Mużyło 2011-09-20 19:20:21 UTC
In that now sys-libs/gdbm might not provide libgdbm_compat and it's not required for gdbm module, just for dbm one.

There's just something wrong if one useflag covers two (now) independent topics.
Comment 8 Rafał Mużyło 2011-09-20 19:43:44 UTC
Looking at the ebuild a bit more, at the same time we could pull the other possible dependency of dbm module - db - out of berkdb useflag, so that that useflag is only for _bsddb module.

It would make for a cleaner distinction of useflag functions.
Comment 9 Dirkjan Ochtman (RETIRED) gentoo-dev 2012-04-12 09:11:32 UTC
Do we have a concrete proposal here?
Comment 10 SpanKY gentoo-dev 2012-07-30 16:32:24 UTC
(In reply to comment #6)

the problem comes up when we want the gdbm module, but don't care about the dbm module.  maybe a new USE flag can address this ?

<flag name="ndbm">Build the simple database module (dbm.ndbm)</flag>

IUSE="+ndbm"
DEPEND="
  ndbm? (
    || (
      gdbm? ( sys-libs/gdbm[berkdb] )
      berkdb? ( sys-libs/db )
    )
  )
  gdbm? ( sys-libs/gdbm )
"
REQUIRE_USE="ndbm? ( || ( gdbm berkdb ) )"

this way we'll only require gdbm[berkdb] when we actually use it, and the gdbm module can be built independently of the (n)dbm module
Comment 11 Pacho Ramos gentoo-dev 2014-07-27 08:50:00 UTC
Looks like this is the last bug blocking gdbm-1.9 tracker, not sure if could be solved finally :/

Should we go with comment #10 suggestion?
Comment 12 Pacho Ramos gentoo-dev 2014-08-10 12:45:58 UTC
Any news? This looks to block https://bugs.gentoo.org/show_bug.cgi?id=518120 currently
Comment 13 Rafał Mużyło 2014-08-10 15:16:43 UTC
(In reply to Pacho Ramos from comment #12)
> Any news? This looks to block https://bugs.gentoo.org/show_bug.cgi?id=518120
> currently

Well, about the only potential problem I see with comment 10 is that it doesn't implement my comment 8 - given that if by this date bsddb3 module is still alive upstream, there should be an option for not building the out of date copy, even if the user prefers bdb as a backend for ndbm.
Comment 14 Alex Xu (Hello71) 2014-08-15 12:03:12 UTC
[07:39:16] <+Arfrever> pacho2: Bug #383757 bug should not block bug #383747. All dev-lang/python ebuilds currently have "gdbm? ( sys-libs/gdbm[berkdb] )" dependency and all sys-libs/gdbm ebuilds have "berkdb" USE flag. Potential changes in IUSE and *DEPEND of dev-lang/python (e.g. splitting of one USE flag into >=2 USE flags) would not be related to gdbm 1.9 (or any newer version).
Comment 15 Arfrever Frehtes Taifersar Arahesis 2014-08-15 12:18:47 UTC
bsddb3 is alive upstream.

I think that there is no point in building dbm (Python 2) / _dbm (Python 3) extension module against Berkeley DB.
(Python 3 has pure-Python dbm.ndbm module, which uses _dbm module.)

I would suggest:

IUSE="... gdbm ndbm ..."
{,R}DEPEND="...
    gdbm? ( sys-libs/gdbm )
    ndbm? ( sys-libs/gdbm[berkdb] )
..."
And no REQUIRED_USE for these USE flags.
Building of these modules would be controlled completely independently.
Comment 16 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-20 21:28:00 UTC
Closing due to no activity.  If someone can figure out how this applies today, feel free to open a new bug with clear explanation of what needs to be done.