From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 24 09:18:54 2022 Received: (at 53406) by debbugs.gnu.org; 24 Jan 2022 14:18:54 +0000 Received: from localhost ([127.0.0.1]:42663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC0BJ-0005uR-OO for submit@debbugs.gnu.org; Mon, 24 Jan 2022 09:18:54 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:49168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nC0BH-0005uB-Ej for 53406@debbugs.gnu.org; Mon, 24 Jan 2022 09:18:53 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id D2BEE2FE; Mon, 24 Jan 2022 15:18:44 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Gtxcu_X0z0SL; Mon, 24 Jan 2022 15:18:43 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 5E6D78B; Mon, 24 Jan 2022 15:18:43 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: John Kehayias Subject: Re: bug#53406: union-build incorrectly handles grafts References: Date: Mon, 24 Jan 2022 15:18:42 +0100 In-Reply-To: (John Kehayias's message of "Fri, 21 Jan 2022 06:48:38 +0000") Message-ID: <878rv5ushp.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: D2BEE2FE X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[protonmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[protonmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53406 Cc: 53406@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, John Kehayias skribis: > If I run the attached file with guix build -f graft-test.scm and look at = libexpat in the created package with, e.g. > > ls -la $(guix build -f graft-test.scm)/lib/libexpat* > > I get > > lrwxrwxrwx 1 root root 71 Dec 31 1969 /gnu/store/a3ixqfx1cfjgbz5gb925fv7= dwy2h55gs-fhs-union-0.0/lib/libexpat.la -> /gnu/store/2q8wwhd3prib0swky68rb= x9hl0xxs6hf-expat-2.4.3/lib/libexpat.la* > lrwxrwxrwx 1 root root 71 Dec 31 1969 /gnu/store/a3ixqfx1cfjgbz5gb925fv7= dwy2h55gs-fhs-union-0.0/lib/libexpat.so -> /gnu/store/2q8wwhd3prib0swky68rb= x9hl0xxs6hf-expat-2.4.3/lib/libexpat.so* > lrwxrwxrwx 1 root root 73 Dec 31 1969 /gnu/store/a3ixqfx1cfjgbz5gb925fv7= dwy2h55gs-fhs-union-0.0/lib/libexpat.so.1 -> /gnu/store/2q8wwhd3prib0swky68= rbx9hl0xxs6hf-expat-2.4.3/lib/libexpat.so.1* > lrwxrwxrwx 1 root root 77 Dec 31 1969 /gnu/store/a3ixqfx1cfjgbz5gb925fv7= dwy2h55gs-fhs-union-0.0/lib/libexpat.so.1.8.1 -> /gnu/store/2q8wwhd3prib0sw= ky68rbx9hl0xxs6hf-expat-2.4.3/lib/libexpat.so.1.8.1 > > Note that the last link is broken: looking at this expat library (2.4.3, = the replacement) it has > > -r-xr-xr-x 1 root root 961 Dec 31 1969 /gnu/store/2q8wwhd3prib0swky68rb= x9hl0xxs6hf-expat-2.4.3/lib/libexpat.la* > lrwxrwxrwx 1 root root 17 Dec 31 1969 /gnu/store/2q8wwhd3prib0swky68rb= x9hl0xxs6hf-expat-2.4.3/lib/libexpat.so -> libexpat.so.1.8.3* > lrwxrwxrwx 1 root root 17 Dec 31 1969 /gnu/store/2q8wwhd3prib0swky68rb= x9hl0xxs6hf-expat-2.4.3/lib/libexpat.so.1 -> libexpat.so.1.8.3* > -r-xr-xr-x 2 root root 191K Dec 31 1969 /gnu/store/2q8wwhd3prib0swky68rb= x9hl0xxs6hf-expat-2.4.3/lib/libexpat.so.1.8.3* > > This is why the last link from the union-build package is broken, it trie= s to point to libexpat.so.1.8.1 (the previous version, but in the newer ver= sion's directory). Grafting is a pretty basic process: in this case it replaces occurrences of /gnu/store/=E2=80=A6-expat-2.4.1 with /gnu/store/=E2=80=A6-expat-2.4.3, = nothing more. It cannot guess that libexpat.so.1.8.1 was renamed to libexpat.so.1.8.3 or anything like that. Is it a problem? Normally no, because users of shared libraries don=E2=80= =99t refer to libraries by their fully-qualified name: --8<---------------cut here---------------start------------->8--- $ objdump -x $(guix build dbus-glib)/bin/dbus-binding-tool|grep NEED.*expat NEEDED libexpat.so.1 $ objdump -x $(guix build dbus-glib)/bin/dbus-binding-tool|grep RUNPATH RUNPATH /gnu/store/wwmxxlmlhwljn39z0gsj6iai3zk67a2g-dbus-gli= b-0.110/lib:/gnu/store/5s6iz5f777rh23q4kv8gvqrsyy61cbjh-dbus-1.12.20/lib:/g= nu/store/s0w7szfsajdy6cnrz2w7z4h5spyl4aaj-expat-2.4.1/lib:/gnu/store/2fk1gz= 2s7ppdicynscra9b19byrrr866-glibc-2.33/lib:/gnu/store/90lbavffg0csrf208nw0ay= j1bz5knl47-gcc-10.3.0-lib/lib:/gnu/store/qqs98rxwjrji6aaf6dqwp7q4m545g2sn-g= lib-2.70.0/lib:/gnu/store/90lbavffg0csrf208nw0ayj1bz5knl47-gcc-10.3.0-lib/l= ib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../.. --8<---------------cut here---------------end--------------->8--- Likewise, =E2=80=98etc/ld.so.cache=E2=80=99 contains a reference to =E2=80= =98libexpat.so.1=E2=80=99, not to =E2=80=98libexpat.so.1.8.1=E2=80=99. Does that make sense? Or am I overlooking something? Thanks, Ludo=E2=80=99.