Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 525126 - =net-nds/openldap-2.4.40 USE=-minimal with dev-db/lmdb - file collision in /usr/share/man/man1/mdb_copy.1.bz2 /usr/share/man/man1/mdb_stat.1.bz2 /usr/bin/mdb_stat /usr/bin/mdb_copy /usr/lib64/liblmdb.so /usr/include/lmdb.h
Summary: =net-nds/openldap-2.4.40 USE=-minimal with dev-db/lmdb - file collision in /u...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo LDAP project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-12 10:30 UTC by Holger Hoffstätte
Modified: 2014-10-27 22:01 UTC (History)
3 users (show)

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


Attachments
openldap-2.4.40-mdb-unbundle.patch (openldap-2.4.40-mdb-unbundle.patch,3.50 KB, patch)
2014-10-24 13:30 UTC, Guillaume Castagnino
Details | Diff
openldap-2.4.40.ebuild.patch (openldap-2.4.40.ebuild.patch,2.54 KB, patch)
2014-10-24 13:31 UTC, Guillaume Castagnino
Details | Diff
Tests and build log with patch dynamically linking to external lmdb applied (build-abi_x86_64.amd64.log,578.53 KB, text/plain)
2014-10-25 07:22 UTC, Guillaume Castagnino
Details
Fix for dev-db/lmdb (lmdb.patch,250 bytes, patch)
2014-10-27 21:01 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Hoffstätte 2014-10-12 10:30:49 UTC
After bug #449776 (add support for slapd-mdb backend) openldap-2.4.40 fails during the install phase with file collisions:

..
 * Detected file collision(s):
 * 
 * /usr/share/man/man1/mdb_copy.1.bz2
 * 	/usr/share/man/man1/mdb_stat.1.bz2
 * 	/usr/bin/mdb_stat
 * 	/usr/bin/mdb_copy
 * 	/usr/lib64/liblmdb.so
 * 	/usr/include/lmdb.h
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * dev-db/lmdb-0.9.13:0::gentoo
 * /usr/bin/mdb_copy
 * /usr/bin/mdb_stat
 * /usr/include/lmdb.h
 * /usr/lib64/liblmdb.so
 * /usr/share/man/man1/mdb_copy.1.bz2
 * /usr/share/man/man1/mdb_stat.1.bz2
 * 
..


Reproducible: Always

Steps to Reproduce:
1. emerge dev-db/lmdb
2. emerge openldap-2.4.40 with -minimal
3. ow!

Actual Results:  
Installaton fails with file collisions.

Expected Results:  
No collisions; openldap and lmdb should be able to coexist.

This looks difficult to solve since lmdb was extracted out of openldap, but openldap embeds the dependency and assumes it is the sole provider of the library..which it no longer is. Using lmdb by itself is very useful - in my case by postfix as much better alternative to berkdb.

Maybe it is possible to make openldap depend on & use the external liblmdb ebuild when necessary? I briefly looked in configure but didn't find an easy way, but am no autoconf guru.

IMHO the only other alternative would be separate library installation paths in order to hide internal libraries from the public parts. Just renaming the internal lib is not going to help due to headers/man pages etc.
Comment 1 Guillaume Castagnino 2014-10-21 09:18:53 UTC
Just to notice, the one embedded in openldap is more recent (0.9.14) than the separate package.

I just compiled postfix against the openldap version, and it seems to work fine.

Perhaps a virtual package provided by both lmdb and openldap should be the correct fix ?
The other option I see  would be unbundling lmdb from openldap
Comment 2 Guillaume Castagnino 2014-10-24 08:25:29 UTC
After looking at openldap build, it seems that the lmdb backend is statically linked to liblmdb.

So without unbundling lmdb, the easiest path would be to simply stop installing liblmdb from openldap package.
If the lmdb tools are needed, just add liblmdb as a dependency
Comment 3 Holger Hoffstätte 2014-10-24 10:29:51 UTC
(In reply to Guillaume Castagnino from comment #2)
> After looking at openldap build, it seems that the lmdb backend is
> statically linked to liblmdb.

Thanks Guillaume - I didn't see that when I filed the bug and was wondering why it would install the library in the first place only for the backend. That's great news!

> So without unbundling lmdb, the easiest path would be to simply stop
> installing liblmdb from openldap package.
> If the lmdb tools are needed, just add liblmdb as a dependency


+1
Comment 4 Guillaume Castagnino 2014-10-24 13:30:21 UTC
Created attachment 387304 [details, diff]
openldap-2.4.40-mdb-unbundle.patch

Patch to unbundle lmdb and dynamically link against liblmdb.so

It seems to work fine on my server.
Comment 5 Guillaume Castagnino 2014-10-24 13:31:16 UTC
Created attachment 387306 [details, diff]
openldap-2.4.40.ebuild.patch

Patch on the ebuild to use together with openldap-2.4.40-mdb-unbundle.patch
Comment 6 Holger Hoffstätte 2014-10-24 14:02:58 UTC
(In reply to Guillaume Castagnino from comment #5)
> Created attachment 387306 [details, diff] [details, diff]
> openldap-2.4.40.ebuild.patch
> 
> Patch on the ebuild to use together with openldap-2.4.40-mdb-unbundle.patch

Applied cleanly & built/installed against lmdb-0.9.14 with no collisions. Nice!
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-10-25 04:50:49 UTC
(In reply to Guillaume Castagnino from comment #1)
> Just to notice, the one embedded in openldap is more recent (0.9.14) than
> the separate package.
> 
> I just compiled postfix against the openldap version, and it seems to work
> fine.
> 
> Perhaps a virtual package provided by both lmdb and openldap should be the
> correct fix ?
> The other option I see  would be unbundling lmdb from openldap
Before I do accept this patch, can you see if openldap safely builds and passes ALL tests with the older version that's in the tree?

and/or get upstream to release a newer separate lmdb.
Comment 8 Guillaume Castagnino 2014-10-25 05:02:25 UTC
(In reply to Robin Johnson from comment #7)
> (In reply to Guillaume Castagnino from comment #1)
> > Just to notice, the one embedded in openldap is more recent (0.9.14) than
> > the separate package.
> > 
> > I just compiled postfix against the openldap version, and it seems to work
> > fine.
> > 
> > Perhaps a virtual package provided by both lmdb and openldap should be the
> > correct fix ?
> > The other option I see  would be unbundling lmdb from openldap
> Before I do accept this patch, can you see if openldap safely builds and
> passes ALL tests with the older version that's in the tree?
> 
> and/or get upstream to release a newer separate lmdb.

Hi,

Upstream already has released the separate version, and it’s in tree since yesterday. That’s why I tried to patch openldap to unbundle it (and the 0.9.14 version is required in the patched ebuild)
Comment 9 Guillaume Castagnino 2014-10-25 07:22:19 UTC
Created attachment 387334 [details]
Tests and build log with patch dynamically linking to external lmdb applied

By the way see attached tests. They seem to pass fine
Comment 10 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-10-27 06:00:28 UTC
InCVS.
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-10-27 06:04:11 UTC
InCVS
Comment 12 Arfrever Frehtes Taifersar Arahesis 2014-10-27 21:01:19 UTC
Collision is still present when trying to upgrade from net-nds/openldap-2.4.40 to net-nds/openldap-2.4.40-r2, because net-nds/openldap-2.4.40-r2 depends on dev-db/lmdb, which collides with still installed net-nds/openldap-2.4.40.

$ emerge -ptv net-nds/openldap

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild     U  ] net-nds/openldap-2.4.40-r2::gentoo [2.4.40::gentoo] USE="crypt gnutls icu ipv6 odbc perl sasl slp ssl syslog tcpd -berkdb -cxx -debug -experimental -iodbc -kerberos -minimal -overlays -samba -selinux -smbkrb5passwd -static-libs" ABI_MIPS="(-n32) (-n64) (-o32)" ABI_PPC="(-32) (-64)" ABI_S390="(-32) (-64)" ABI_X86="32 (64) (-x32)" 0 KiB
[ebuild  N     ]  dev-db/lmdb-0.9.14::gentoo  USE="-static-libs" 0 KiB

Total: 2 packages (1 upgrade, 1 new), Size of downloads: 0 KiB



 * package dev-db/lmdb-0.9.14 NOT merged
 * 
 * Detected file collision(s):
 * 
 *      /usr/bin/mdb_copy
 *      /usr/bin/mdb_stat
 *      /usr/bin/mdb_dump
 *      /usr/bin/mdb_load
 *      /usr/share/man/man1/mdb_dump.1.bz2
 *      /usr/share/man/man1/mdb_stat.1.bz2
 *      /usr/share/man/man1/mdb_load.1.bz2
 *      /usr/share/man/man1/mdb_copy.1.bz2
 *      /usr/include/lmdb.h
 *      /usr/lib64/liblmdb.so
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * net-nds/openldap-2.4.40:0::gentoo
 *      /usr/bin/mdb_copy
 *      /usr/bin/mdb_dump
 *      /usr/bin/mdb_load
 *      /usr/bin/mdb_stat
 *      /usr/include/lmdb.h
 *      /usr/lib64/liblmdb.so
 *      /usr/share/man/man1/mdb_copy.1.bz2
 *      /usr/share/man/man1/mdb_dump.1.bz2
 *      /usr/share/man/man1/mdb_load.1.bz2
 *      /usr/share/man/man1/mdb_stat.1.bz2
Comment 13 Arfrever Frehtes Taifersar Arahesis 2014-10-27 21:01:58 UTC
Created attachment 387588 [details, diff]
Fix for dev-db/lmdb
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2014-10-27 22:01:54 UTC
Thanks arferver, that fix is applied now.