Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274595 - net-mail/cyrus-imapd compiles against sys-libs/db:4.6 but links against sys-libs/db:4.7 if installed
Summary: net-mail/cyrus-imapd compiles against sys-libs/db:4.6 but links against sys-l...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Tobias Scherbaum (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-18 10:15 UTC by emerald
Modified: 2009-07-09 19:04 UTC (History)
2 users (show)

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


Attachments
emerge --info (emerge.info,14.81 KB, text/plain)
2009-06-18 10:20 UTC, emerald
Details
Patch to cyrus-imapd-2.3.14-r1 to let it build with the latest version of db in the system (cyrus-impad-2.3.14-r1.patch,667 bytes, patch)
2009-07-06 00:48 UTC, Jorge Manuel B. S. Vicetto (RETIRED)
Details | Diff
Patch to remove the rpath manipulation in berkdb.m4 (cyrus-imapd-fix-db-rpath.patch,1.12 KB, patch)
2009-07-07 03:40 UTC, Jorge Manuel B. S. Vicetto (RETIRED)
Details | Diff
cyrus-imapd-2.3.14-db47.patch (cyrus-imapd-2.3.14-db47.patch,805 bytes, patch)
2009-07-07 17:41 UTC, Tobias Scherbaum (RETIRED)
Details | Diff
Patch to fix several RPATH issues on cyrus-imapd (cyrus-imapd-fix-db-rpath.patch,3.14 KB, patch)
2009-07-09 17:46 UTC, Jorge Manuel B. S. Vicetto (RETIRED)
Details | Diff
Patch for cyrus-imapd-2.3.14-r1 (cyrus-imapd-2.3.14-r1.patch,1012 bytes, patch)
2009-07-09 17:49 UTC, Jorge Manuel B. S. Vicetto (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description emerald 2009-06-18 10:15:39 UTC
... and subsequently fails with following error:

fry ~ # /usr/lib64/cyrus/master -D
No log handling enabled - turning on stderr logging
Warning: Failed to connect to the agentx master agent ([NIL]):
fatal error: wrong db version
fatal error: wrong db version
fatal error: wrong db version
fatal error: wrong db version


uninstalling sys-libs/db:4.7 before merging cyrus-imapd makes it compile and 
link correctly and subsequently work (although all links to db:4.7 are broken 
then, so db:4.7 needs to be installed again, till the next cyrus-imapd merge).
Comment 1 emerald 2009-06-18 10:20:50 UTC
Created attachment 195054 [details]
emerge --info
Comment 2 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-07-06 00:48:42 UTC
Created attachment 196858 [details, diff]
Patch to cyrus-imapd-2.3.14-r1 to let it build with the latest version of db in the system

With the help of Diego (flameeyes), here is a patch that allows cyrus-imapd to build with db-4.7. This patch will make it use db-4.7.
It's also possible to force the use of db-4.6 - the latest version supported by upstream.
Comment 3 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-07-07 03:33:23 UTC
Although the patch allows cyrus-imapd to use db-4.7:

scanelf -n /usr/lib/cyrus/*
 TYPE   NEEDED FILE
ET_EXEC libsasl2.so.2,libssl.so.0.9.8,libcrypto.so.0.9.8,libresolv.so.2,libdb-4.7.so,libpcre.so.0,libpcreposix.so.0,libc.so.6 /usr/lib/cyrus/arbitron
ET_EXEC libsasl2.so.2,libssl.so.0.9.8,libcrypto.so.0.9.8,libresolv.so.2,libdb-4.7.so,libpcre.so.0,libpcreposix.so.0,libc.so.6 /usr/lib/cyrus/chk_cyrus

it causes a serious issue by passing a relative path to RPATH:

scanelf -r /usr/lib/cyrus/*
 TYPE   RPATH FILE
ET_EXEC db-4.7/lib /usr/lib/cyrus/arbitron
ET_EXEC db-4.7/lib /usr/lib/cyrus/chk_cyrus

Ned (solar) helped me trace it and it seemed to come from:
cmulocal/berkdb.m4:         RPATH="-Wl,-rpath,${DB_LIB_DIR}"

However, after adding a patch to remove all the calls from berkdb.m4, it's still adding db-4.7/lib to the rpath. I'm attaching the non-working patch next.
Comment 4 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-07-07 03:40:47 UTC
Created attachment 196985 [details, diff]
Patch to remove the rpath manipulation in berkdb.m4
Comment 5 Tobias Scherbaum (RETIRED) gentoo-dev 2009-07-07 17:41:27 UTC
Created attachment 197107 [details, diff]
cyrus-imapd-2.3.14-db47.patch

Try this one, please.
Comment 6 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-07-09 17:46:48 UTC
Created attachment 197376 [details, diff]
Patch to fix several RPATH issues on cyrus-imapd

This patch fixes quite a few issues with RPATH in cyrus-imapd.
Without the patch, any call of --with-bdb in ./configure results in partial paths being added to the RPATH of the libs and executables as stated on comment #3 about the patch on comment #2.
Comment 7 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2009-07-09 17:49:30 UTC
Created attachment 197377 [details, diff]
Patch for cyrus-imapd-2.3.14-r1

This patch to the ebuild adds support for the patches in comment 5 and comment 6.
Comment 8 Tobias Scherbaum (RETIRED) gentoo-dev 2009-07-09 19:04:54 UTC
(In reply to comment #7)
> Created an attachment (id=197377) [edit]
> Patch for cyrus-imapd-2.3.14-r1
> 
> This patch to the ebuild adds support for the patches in comment 5 and comment
> 6.
> 

Fixed in 2.3.14-r2. Thanks!