From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] gnu: Add openldap. Date: Sat, 26 Jan 2013 23:36:53 +0100 Message-ID: <87zjzv8tbu.fsf@gnu.org> References: <201301262037.22115.andreas@enge.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:39487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzEMt-0007Ex-O5 for bug-guix@gnu.org; Sat, 26 Jan 2013 17:37:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TzEMr-0007Gj-JC for bug-guix@gnu.org; Sat, 26 Jan 2013 17:36:59 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:51682) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TzEMr-0007GN-5b for bug-guix@gnu.org; Sat, 26 Jan 2013 17:36:57 -0500 In-Reply-To: <201301262037.22115.andreas@enge.fr> (Andreas Enge's message of "Sat, 26 Jan 2013 20:37:22 +0100") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Andreas Enge Cc: bug-guix@gnu.org Andreas Enge skribis: > Attached a patch for openldap, the test phase of which was really tricky. Builds fine for me when tests are turned off. > Since there are dynamically linked independent server and client programs= ,=20 > I had to set LD_LIBRARY_PATH. That=E2=80=99s a problem. The problem is that the servers/slapd executable= ends up without libdb in its RUNPATH: --8<---------------cut here---------------start------------->8--- $ objdump -x /tmp/nix-build-openldap-2.4.33.drv-0/openldap-2.4.33/tests/../= servers/slapd/slapd |grep RUNPATH RUNPATH /nix/store/n0m40arwkv84ispnah1hma7526bw0llk-cyrus-sa= sl-2.1.26/lib:/nix/store/9fnjjsbarscbmakr44ixfv9yhg6z12mw-glibc-2.17/lib:/n= ix/store/lwc6sygaglzfk17v3w15cc2xv97fjgci-gcc-4.7.2/lib64:/nix/store/lwc6sy= gaglzfk17v3w15cc2xv97fjgci-gcc-4.7.2/lib:/nix/store/b8vagvbwasqwy8wv8545np4= 0ra468c3p-icu4c-50.1.1/lib:/nix/store/ip943rzyiak1k06h7p2srily1wz73hsd-open= ssl-1.0.1c/lib --8<---------------cut here---------------end--------------->8--- That binary gets built like this: --8<---------------cut here---------------start------------->8--- /nix/store/ryk1ywzz31kp4biclxq3yq6hpjycalyy-bash-4.2/bin/sh ../../libtool -= -mode=3Dlink gcc -static -g -O2 -o slapd main.o globals.o bconfig.o con= fig.o daemon.o connection.o search.o filter.o add.o cr.o attr.o entry.o bac= kend.o backends.o result.o operation.o dn.o compare.o modify.o delete.o mod= rdn.o ch_malloc.o value.o ava.o bind.o unbind.o abandon.o filterentry.o pho= netic.o acl.o str2filter.o aclparse.o init.o user.o lock.o controls.o exten= ded.o passwd.o schema.o schema_check.o schema_init.o schema_prep.o schemapa= rse.o ad.o at.o mr.o syntax.o oc.o saslauthz.o oidm.o starttls.o index.o se= ts.o referral.o root_dse.o sasl.o module.o mra.o mods.o sl_malloc.o zn_mall= oc.o limits.o operational.o matchedValues.o cancel.o syncrepl.o backglue.o = backover.o ctxcsn.o ldapsync.o frontend.o slapadd.o slapcat.o slapcommon.o = slapdn.o slapindex.o slappasswd.o slaptest.o slapauth.o slapacl.o component= .o aci.o alock.o txn.o slapschema.o version.o libbackends.a liboverlays.a = ../../libraries/liblunicode/liblunicode.a ../../libraries/librewrite/librew= rite.a ../../libraries/liblutil/liblutil.a ../../libraries/libldap_r/liblda= p_r.la ../../libraries/liblber/liblber.la -ldb-5.3 -licuuc -licudata = -lsasl2 -lssl -lcrypto -lresolv -pthread \ =09 mkdir .libs gcc -g -O2 -o slapd main.o globals.o bconfig.o config.o daemon.o connection= .o search.o filter.o add.o cr.o attr.o entry.o backend.o backends.o result.= o operation.o dn.o compare.o modify.o delete.o modrdn.o ch_malloc.o value.o= ava.o bind.o unbind.o abandon.o filterentry.o phonetic.o acl.o str2filter.= o aclparse.o init.o user.o lock.o controls.o extended.o passwd.o schema.o s= chema_check.o schema_init.o schema_prep.o schemaparse.o ad.o at.o mr.o synt= ax.o oc.o saslauthz.o oidm.o starttls.o index.o sets.o referral.o root_dse.= o sasl.o module.o mra.o mods.o sl_malloc.o zn_malloc.o limits.o operational= .o matchedValues.o cancel.o syncrepl.o backglue.o backover.o ctxcsn.o ldaps= ync.o frontend.o slapadd.o slapcat.o slapcommon.o slapdn.o slapindex.o slap= passwd.o slaptest.o slapauth.o slapacl.o component.o aci.o alock.o txn.o sl= apschema.o version.o -pthread libbackends.a liboverlays.a ../../libraries/= liblunicode/liblunicode.a ../../libraries/librewrite/librewrite.a ../../lib= raries/liblutil/liblutil.a ../../libraries/libldap_r/.libs/libldap_r.a /tmp= /nix-build-openldap-2.4.33.drv-0/openldap-2.4.33/libraries/liblber/.libs/li= blber.a ../../libraries/liblber/.libs/liblber.a /nix/store/c6hmllvdzgphyfb9= pwaad42mzdf3kx8w-bdb-5.3.21/lib/libdb-5.3.so -lpthread -licuuc -licudata /n= ix/store/n0m40arwkv84ispnah1hma7526bw0llk-cyrus-sasl-2.1.26/lib/libsasl2.so= -ldl -lssl -lcrypto -lresolv -pthread -Wl,--rpath -Wl,/nix/store/n0m40arwk= v84ispnah1hma7526bw0llk-cyrus-sasl-2.1.26/lib -Wl,--rpath -Wl,/nix/store/n0= m40arwkv84ispnah1hma7526bw0llk-cyrus-sasl-2.1.26/lib --8<---------------cut here---------------end--------------->8--- As you can see, libtool replaced -ldb-5.3 by the corresponding absolute file name. However, our ld-wrapper only adds to the RUNPATH directories when they contain libraries passed via -l. We can fix that eventually, but that=E2= =80=99s not the problem here. Here=E2=80=99s a hint: --8<---------------cut here---------------start------------->8--- $ /tmp/nix-build-openldap-2.4.33.drv-0/openldap-2.4.33/libtool --version ltmain.sh (GNU libtool) 1.5.22-OpenLDAP (1.1220.2.365 2005/12/18 22:14:06) --8<---------------cut here---------------end--------------->8--- This is not only old, but also hacked in unknown ways. So, here=E2=80=99s what I tried: --8<---------------cut here---------------start------------->8--- [ludo@pluto:/tmp/nix-build-openldap-2.4.33.drv-0/openldap-2.4.33]$ cp `type= -P libtool` . [ludo@pluto:/tmp/nix-build-openldap-2.4.33.drv-0/openldap-2.4.33]$ ./libtoo= l --version libtool (GNU libtool) 2.4.2 Written by Gordon Matzigkeit , 1996 Copyright (C) 2011 Free Software Foundation, Inc.=20=20 This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [ludo@pluto:/tmp/nix-build-openldap-2.4.33.drv-0/openldap-2.4.33]$ bash [ludo@pluto:/tmp/nix-build-openldap-2.4.33.drv-0/openldap-2.4.33]$ source .= ./environment-variables [ludo@pluto:/tmp/nix-build-openldap-2.4.33.drv-0]$ rm servers/slapd/slapd [ludo@pluto:/tmp/nix-build-openldap-2.4.33.drv-0]$ make -C servers/slapd/ [...] /nix/store/ryk1ywzz31kp4biclxq3yq6hpjycalyy-bash-4.2/bin/sh ../../libtool -= -mode=3Dlink gcc -static -g -O2 -o slapd main.o globals.o bconfig.o con= fig.o daemon.o connection.o search.o filter.o add.o cr.o attr.o entry.o bac= kend.o backends.o result.o operation.o dn.o compare.o modify.o delete.o mod= rdn.o ch_malloc.o value.o ava.o bind.o unbind.o abandon.o filterentry.o pho= netic.o acl.o str2filter.o aclparse.o init.o user.o lock.o controls.o exten= ded.o passwd.o schema.o schema_check.o schema_init.o schema_prep.o schemapa= rse.o ad.o at.o mr.o syntax.o oc.o saslauthz.o oidm.o starttls.o index.o se= ts.o referral.o root_dse.o sasl.o module.o mra.o mods.o sl_malloc.o zn_mall= oc.o limits.o operational.o matchedValues.o cancel.o syncrepl.o backglue.o = backover.o ctxcsn.o ldapsync.o frontend.o slapadd.o slapcat.o slapcommon.o = slapdn.o slapindex.o slappasswd.o slaptest.o slapauth.o slapacl.o component= .o aci.o alock.o txn.o slapschema.o version.o libbackends.a liboverlays.a = ../../libraries/liblunicode/liblunicode.a ../../libraries/librewrite/librew= rite.a ../../libraries/liblutil/liblutil.a ../../libraries/libldap_r/liblda= p_r.la ../../libraries/liblber/liblber.la -ldb-5.3 -licuuc -licudata = -lsasl2 -lssl -lcrypto -lresolv -pthread \ libtool: link: gcc -g -O2 -o slapd main.o globals.o bconfig.o config.o daem= on.o connection.o search.o filter.o add.o cr.o attr.o entry.o backend.o bac= kends.o result.o operation.o dn.o compare.o modify.o delete.o modrdn.o ch_m= alloc.o value.o ava.o bind.o unbind.o abandon.o filterentry.o phonetic.o ac= l.o str2filter.o aclparse.o init.o user.o lock.o controls.o extended.o pass= wd.o schema.o schema_check.o schema_init.o schema_prep.o schemaparse.o ad.o= at.o mr.o syntax.o oc.o saslauthz.o oidm.o starttls.o index.o sets.o refer= ral.o root_dse.o sasl.o module.o mra.o mods.o sl_malloc.o zn_malloc.o limit= s.o operational.o matchedValues.o cancel.o syncrepl.o backglue.o backover.o= ctxcsn.o ldapsync.o frontend.o slapadd.o slapcat.o slapcommon.o slapdn.o s= lapindex.o slappasswd.o slaptest.o slapauth.o slapacl.o component.o aci.o a= lock.o txn.o slapschema.o version.o -pthread libbackends.a liboverlays.a .= ./../libraries/liblunicode/liblunicode.a ../../libraries/librewrite/librewr= ite.a ../../libraries/liblutil/liblutil.a ../../libraries/libldap_r/.libs/l= ibldap_r.a /tmp/nix-build-openldap-2.4.33.drv-0/openldap-2.4.33/libraries/l= iblber/.libs/liblber.a ../../libraries/liblber/.libs/liblber.a -ldb-5.3 -li= cuuc -licudata /nix/store/n0m40arwkv84ispnah1hma7526bw0llk-cyrus-sasl-2.1.2= 6/lib/libsasl2.so -ldl -lssl -lcrypto -lresolv -pthread -Wl,-rpath -Wl,/nix= /store/n0m40arwkv84ispnah1hma7526bw0llk-cyrus-sasl-2.1.26/lib -Wl,-rpath -W= l,/nix/store/n0m40arwkv84ispnah1hma7526bw0llk-cyrus-sasl-2.1.26/lib rm -f slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl= slapschema --8<---------------cut here---------------end--------------->8--- Surprise, -ldb5.3 is used now, and thus it ends up in the RPATH. So I would suggest adding Libtool/bin as an input, and adding a phase that does (copy-file (which "libtool") "libtool") right after =E2=80=98conf= igure=E2=80=99. > Still, one test failed, but not all the time: It succeeded once when > run in the build tree. So I took it out. Even then, some test fails > from time to time; sometimes after an hour of different tests passing, > sometimes after 15 minutes. Did you check whether it does DNS lookups or similar? If it turns out to be this unreliable, then yes, it=E2=80=99s safer to disa= ble them. Thanks, Ludo=E2=80=99.