From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 242106DE0228 for ; Sat, 26 May 2018 15:23:30 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[AWL=0.011, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RBUcJGLDVRqB for ; Sat, 26 May 2018 15:23:29 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 063F86DE01E8 for ; Sat, 26 May 2018 15:23:28 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1fMhaw-0001DJ-Ps for notmuch@notmuchmail.org; Sat, 26 May 2018 18:23:26 -0400 Received: (nullmailer pid 9225 invoked by uid 1000); Sat, 26 May 2018 22:23:24 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: setting LIBDIR_IN_LDCONFIG fails if /lib is a symlink to /usr/lib X-List-To: notmuch Date: Sat, 26 May 2018 15:23:24 -0700 Message-ID: <87h8mut5sz.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 May 2018 22:23:30 -0000 On my laptop, /lib is a symlink to to /usr/lib (this might or might not be a good idea, but is likely to become increasingly common if some people get their way). $ /sbin/ldconfig -NX -v | grep -v ^$'\t' yields /sbin/ldconfig: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory /sbin/ldconfig: Path `/usr/lib/x86_64-linux-gnu' given more than once /sbin/ldconfig: Path `/lib/x86_64-linux-gnu' given more than once /sbin/ldconfig: Path `/usr/lib/x86_64-linux-gnu' given more than once /sbin/ldconfig: Path `/usr/lib' given more than once /usr/lib/x86_64-linux-gnu/libfakeroot: /usr/local/lib: /lib/x86_64-linux-gnu: /sbin/ldconfig: /lib/x86_64-linux-gnu/ld-2.27.so is the dynamic linker, ignoring /lib: with libdir=/usr/lib/x86_64-linux-gnu, our sed hackery fails, since the directory we are looking for never appears at the beggining of a line. One option is to do more proccesing of the output and look for the path in "given more than once" lines as well. Still, this is an obviously fragile way of doing things (parsing human readable output from ldconfig), so I wondered if anyone has some better ideas. This informattion is used two places 1) to avoid adding an unecessary RPATH to the binary. Having such an RPATH will cause at least Debian (and I suppose other distro) tooling to complain loudly. 2) To know whether to run ldconfig after installing the library.