From owner-freebsd-stable@FreeBSD.ORG Sun Sep 8 07:28:40 2013 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 55313371 for ; Sun, 8 Sep 2013 07:28:40 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BBBC62ED8 for ; Sun, 8 Sep 2013 07:28:39 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id x18so3999318lbi.24 for ; Sun, 08 Sep 2013 00:28:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=ew10/GkmT+FuMpBV6+qeOlSkpfEHUMgrOHnyJIoc21o=; b=TWp05rD3NEEoCu+t/BqTcSafWnrYzBQesDkCuunCyEQE/oJSyHX88FkQ2NWCssqr1e 5soei65mFmNROq3XlIYYH1ddbJYBtogWyeVVwqtvOrsTZyvqTL9oYSLo0zR48SqrjKA2 BxvuhkwtBiWq7E9e68fGc0E3vhWltHBslo4scb4+nEN3IEqaP6RkQ2QHdk2CgZpPGjgA ne6BiV+cTGfCkGjKQ0L6XZydnbGCy/S6kBb28DdGpehCXhqlxoSXsxNRWERoKmm8ye1s 2gddX0yWCC4gCTfGbcEEsxOLDcmR+iZWzFz4LKSBliYwpGvH9uRrPqWfRr+BlPx9eG8L dFdQ== X-Gm-Message-State: ALoCoQmZeMgFnYY1GTrYckGlUnaq6BFEhq8cSmeJAQvOfgqctC4/ZXK5ditg29x8RgVAZ9CY6HZ1 MIME-Version: 1.0 X-Received: by 10.152.8.115 with SMTP id q19mr10733542laa.16.1378625312397; Sun, 08 Sep 2013 00:28:32 -0700 (PDT) Received: by 10.114.230.66 with HTTP; Sun, 8 Sep 2013 00:28:32 -0700 (PDT) In-Reply-To: References: Date: Sun, 8 Sep 2013 00:28:32 -0700 Message-ID: Subject: Re: Troubles with dependencies (file -L is broken?) From: Maxim Sobolev To: stable@freebsd.org, ports@freebsd.org, portmgr@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Sep 2013 07:28:40 -0000 P.S. This is fresh 9.2-RC3 with /usr on ZFS. -Maxim On Sun, Sep 8, 2013 at 12:09 AM, Maxim Sobolev wrote: > Hi, > > I am trying to portupgrade my subversion and it keeps trying to install > databases/db42 over already installed version (same version), missing the > shared library dependency. > > Adding some debug into bsd.port.mk, I see: > > =3D=3D=3D> subversion-1.8.3 depends on package: libtool>=3D2.4 - found > set -x; set -e ; for i in libdb-4.2.so:/usr/ports/databases/db42; do > lib=3D${i%%:*} ; dir=3D${i#*:} ; target=3D"install"; depends_args=3D"= "; echo > -n "=3D=3D=3D> subversion-1.8.3 depends on shared library: ${lib}" ; f= ound=3D0 > ; dirs=3D"/lib /usr/lib /usr/local/lib `/bin/cat > /usr/local/libdata/ldconfig/* 2>/dev/null || : `" ; for libdir in $dirs; > do test -f ${libdir}/${lib} || continue; if [ -x /usr/bin/file ]; then = [ > `file -b -L --mime-type ${libdir}/${lib}` =3D "application/x-sharedlib" ]= || > continue ; fi ; found=3D1 ; echo " - found"; done ; if [ ${found} -e= q 0 > ]; then echo " - not found"; echo "=3D=3D=3D> Verifying for $lib in = $dir"; > if [ ! -d "$dir" ] ; then echo " =3D> No directory for $lib. > Skipping.."; else if [ -n "" -o -n "" ]; then subpkgfile=3D`(cd $dir; = make > $depends_args -V PKGFILE)`; subpkgname=3D${subpkgfile%-*} ; > subpkgname=3D${subpkgname##*/} ; if [ -r "${subpkgfile}" -a "$target" = =3D > "install" ]; then echo "=3D=3D=3D> Installing existing package > ${subpkgfile}"; if [ -n "" -a ${subpkgname} =3D "pkg" ]; then [ -d > /usr/ports/devel/subversion/work ] || /bin/mkdir -p > /usr/ports/devel/subversion/work ; /usr/bin/tar xf ${subpkgfile} -C > /usr/ports/devel/subversion/work -s ",/.*/,,g" "*/pkg-static" ; > /usr/ports/devel/subversion/work/pkg-static add ${subpkgfile}; /bin/rm -= f > /usr/ports/devel/subversion/work/pkg-static; else /usr/sbin/pkg_add > ${subpkgfile}; fi; elif [ -n "" -a "${target}" =3D "install" ]; then e= cho > "=3D=3D=3D> subversion-1.8.3 depends on package: ${subpkgfile} - not fo= und"; > echo "=3D=3D=3D> USE_PACKAGE_DEPENDS_ONLY set - will not build from sou= rce"; > exit 1; else (cd $dir; make -DINSTALLS_DEPENDS $target $depends_args) ; > fi; else (cd $dir; make -DINSTALLS_DEPENDS $target $depends_args) ; fi= ; > echo "=3D=3D=3D> Returning to build of subversion-1.8.3"; fi ; fi ; = done > + set -e > + lib=3Dlibdb-4.2.so > + dir=3D/usr/ports/databases/db42 > + target=3Dinstall > + depends_args=3D'' > + echo -n '=3D=3D=3D> subversion-1.8.3 depends on shared library: libdb= -4.2.so > ' > =3D=3D=3D> subversion-1.8.3 depends on shared library: libdb-4.2.so+ fo= und=3D0 > + /bin/cat /usr/local/libdata/ldconfig/compat7x > /usr/local/libdata/ldconfig/mysql /usr/local/libdata/ldconfig/portupgrade > /usr/local/libdata/ldconfig/pth > + dirs=3D'/lib /usr/lib /usr/local/lib /usr/local/lib/compat > /usr/local/lib/mysql > /usr/local/lib/compat/pkg > /usr/local/lib/pth' > + test -f /lib/libdb-4.2.so > + continue > + test -f /usr/lib/libdb-4.2.so > + continue > + test -f /usr/local/lib/libdb-4.2.so > + [ -x /usr/bin/file ] > + file -b -L --mime-type /usr/local/lib/libdb-4.2.so > + [ inode/symlink =3D application/x-sharedlib ] > + continue > + test -f /usr/local/lib/compat/libdb-4.2.so > + continue > + test -f /usr/local/lib/mysql/libdb-4.2.so > + continue > + test -f /usr/local/lib/compat/pkg/libdb-4.2.so > + continue > + test -f /usr/local/lib/pth/libdb-4.2.so > + continue > + [ 0 -eq 0 ] > + echo ' - not found' > - not found > + echo '=3D=3D=3D> Verifying for libdb-4.2.so in /usr/ports/databases/= db42' > =3D=3D=3D> Verifying for libdb-4.2.so in /usr/ports/databases/db42 > > So, file(1) call is the culprit here. Trying to reproduce in the console: > > [sobomax@pioneer ~]$ file -b -L --mime-type /usr/local/lib/libdb-4.2.so > inode/symlink > > However: > > [sobomax@pioneer ~]$ hexdump -C /usr/local/lib/libdb-4.2.so | head -n 20 > 00000000 7f 45 4c 46 02 01 01 09 00 00 00 00 00 00 00 00 > |.ELF............| > 00000010 03 00 3e 00 01 00 00 00 d0 40 02 00 00 00 00 00 > |..>.....=D0=BF@......| > 00000020 40 00 00 00 00 00 00 00 b8 a6 0e 00 00 00 00 00 > |@.......=E2=95=A6=D1=96......| > 00000030 00 00 00 00 40 00 38 00 05 00 40 00 1d 00 1a 00 |....@.8...@ > .....| > 00000040 01 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 > |................| > 00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > |................| > 00000060 dc 45 0e 00 00 00 00 00 dc 45 0e 00 00 00 00 00 > |=D1=8DE......=D1=8DE......| > 00000070 00 00 20 00 00 00 00 00 01 00 00 00 06 00 00 00 |.. > .............| > 00000080 00 50 0e 00 00 00 00 00 00 50 2e 00 00 00 00 00 > |.P.......P......| > 00000090 00 50 2e 00 00 00 00 00 fc 36 00 00 00 00 00 00 > |.P......=D0=AD6......| > 000000a0 d8 3a 00 00 00 00 00 00 00 00 20 00 00 00 00 00 |=D1=8C:.....= ... > .....| > 000000b0 02 00 00 00 06 00 00 00 e8 54 0e 00 00 00 00 00 > |........=D0=A5T......| > 000000c0 e8 54 2e 00 00 00 00 00 e8 54 2e 00 00 00 00 00 > |=D0=A5T......=D0=A5T......| > 000000d0 a0 01 00 00 00 00 00 00 a0 01 00 00 00 00 00 00 > |=E2=95=90.......=E2=95=90.......| > 000000e0 08 00 00 00 00 00 00 00 50 e5 74 64 04 00 00 00 > |........P=D0=95td....| > 000000f0 5c 39 0d 00 00 00 00 00 5c 39 0d 00 00 00 00 00 > |\9......\9......| > 00000100 5c 39 0d 00 00 00 00 00 b4 34 00 00 00 00 00 00 > |\9......=D0=844......| > 00000110 b4 34 00 00 00 00 00 00 04 00 00 00 00 00 00 00 > |=D0=844..............| > > The culprit is that /usr/local/lib/libdb-4.2.so is a symlink to another > symlink to another symlink etc, so that my guess is that file(1) stops at > the first one. The issue can be resolved by using realpath(1), attached > patch fixes it for me. > > [sobomax@pioneer ~]$ realpath /usr/local/lib/libdb-4.2.so > /usr/local/lib/db42/libdb-4.2.so.2 > [sobomax@pioneer ~]$ file -b -L --mime-type > /usr/local/lib/db42/libdb-4.2.so.2 > application/x-sharedlib > [sobomax@pioneer ~]$ ls -l /usr/local/lib/libdb-4.2.so > lrwxr-xr-x 1 root wheel 14 7 =D1=81=D0=B5=D0=BD 21:43 /usr/local/lib/= libdb-4.2.so -> > libdb-4.2.so.2 > > I am not sure what's the process to get bsd.port.mk adjusted these days. > Should I open a PR and assign it to portmgr? > > -Maxim > > --=20 Maksym Sobolyev Sippy Software, Inc. Internet Telephony (VoIP) Experts Tel (Canada): +1-778-783-0474 Tel (Toll-Free): +1-855-747-7779 Fax: +1-866-857-6942 Web: http://www.sippysoft.com MSN: sales@sippysoft.com Skype: SippySoft