From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 25 08:47:53 2022 Received: (at 53406) by debbugs.gnu.org; 25 Jan 2022 13:47:53 +0000 Received: from localhost ([127.0.0.1]:47469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCMAr-0005n2-8X for submit@debbugs.gnu.org; Tue, 25 Jan 2022 08:47:53 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:56364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nCMAo-0005m6-Df for 53406@debbugs.gnu.org; Tue, 25 Jan 2022 08:47:51 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E66BB1E8; Tue, 25 Jan 2022 14:47:43 +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 WZnu94PIBy87; Tue, 25 Jan 2022 14:47:42 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 313D78B; Tue, 25 Jan 2022 14:47:42 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: John Kehayias Subject: Re: bug#53406: union-build incorrectly handles grafts References: <878rv5ushp.fsf@gnu.org> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 6 =?utf-8?Q?Pluvi=C3=B4se?= an 230 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 25 Jan 2022 14:47:41 +0100 In-Reply-To: (John Kehayias's message of "Tue, 25 Jan 2022 03:22:44 +0000") Message-ID: <87bl00lyf6.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: E66BB1E8 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, John Kehayias skribis: > Yes, that makes sense, thank you for clarifying. So this is the currently= expected behavior. Ideally grafting would be smarter to maybe avoid this (= missing changes in e.g. version number)? But I would guess this is not some= thing that would be expected to cause a problem for the vast majority of ca= ses, as you explain, and adds complexity to the process. I don=E2=80=99t think it can be smarter; grafting is just text substitution= , it knows nothing about the files it=E2=80=99s fiddling with (with the exceptio= n of debugging sections in ELF files). > Perhaps I was too hasty in noting this "problem" which like I said was no= t the error I originally encountered. I was using a package that constructs= both the 64- and 32-bit libraries to put in a container (say, a /lib32 and= /lib64 or something similar to an FHS environment). A collision was happen= ing between a file and directory, one being a good symlink and the other br= oken, rather than a "real" mismatch in file vs directory. Anyway, going bac= k to that what I see is that one link is broken for the above reasons, but = the good one is good because it is to the *ungrafted* library store path. I= don't know now if these 2 things are connected other than one led me to th= e other, but I turn now to what demonstrates my original problem. > > I don't know why this happens or if it is something in this building proc= ess that is not correct, but I did come up with a minimal example (attached= ). The code is a bit odd in its stripped down form, though hopefully is cle= ar in what way this would be used to do something useful (again, like an FH= S environment or other container). Apologies for the old style and lack of = gexps which I'm finally getting used to. The example package just tries to = make a dummy package that has, for illustration, a "/lib64" and "/lib32" wh= ich link to the respective union-build inputs (of a single library for simp= licity). I don't think the actual package being made matters so much, or ho= w it is constructed, but that two inputs are union-builds of the same libra= ry (x86_64 and i686) which should have a graft of expat. Just my guess thou= gh. > > Doing: > > ls -la $(guix build -f graft-test.scm)/lib64/lib/libexpat* > lrwxrwxrwx 1 root root 71 Dec 31 1969 /gnu/store/qbh16hfdv8pnfw01k6izbs3= jkji6i978-test-pkg-0.0/lib64/lib/libexpat.la -> /gnu/store/2q8wwhd3prib0swk= y68rbx9hl0xxs6hf-expat-2.4.3/lib/libexpat.la* > lrwxrwxrwx 1 root root 71 Dec 31 1969 /gnu/store/qbh16hfdv8pnfw01k6izbs3= jkji6i978-test-pkg-0.0/lib64/lib/libexpat.so -> /gnu/store/2q8wwhd3prib0swk= y68rbx9hl0xxs6hf-expat-2.4.3/lib/libexpat.so* > lrwxrwxrwx 1 root root 73 Dec 31 1969 /gnu/store/qbh16hfdv8pnfw01k6izbs3= jkji6i978-test-pkg-0.0/lib64/lib/libexpat.so.1 -> /gnu/store/2q8wwhd3prib0s= wky68rbx9hl0xxs6hf-expat-2.4.3/lib/libexpat.so.1* > lrwxrwxrwx 1 root root 77 Dec 31 1969 /gnu/store/qbh16hfdv8pnfw01k6izbs3= jkji6i978-test-pkg-0.0/lib64/lib/libexpat.so.1.8.1 -> /gnu/store/2q8wwhd3pr= ib0swky68rbx9hl0xxs6hf-expat-2.4.3/lib/libexpat.so.1.8.1 > > is what we saw already: libexpat is the newer (replacement, 2.4.3) versio= n, with the full version symlink broken since the version number is wrong. = Likewise in other pieces that have the version number, like share/doc. Okay= , that's expected. But now, in the i686-linux union-build input: > > ls -la $(guix build -f graft-test.scm)/lib32/lib/libexpat* > lrwxrwxrwx 1 root root 71 Dec 31 1969 /gnu/store/qbh16hfdv8pnfw01k6izbs3= jkji6i978-test-pkg-0.0/lib32/lib/libexpat.la -> /gnu/store/b0jns3vzhhpna7li= m8bc3dr0payzx5yy-expat-2.4.1/lib/libexpat.la* > lrwxrwxrwx 1 root root 71 Dec 31 1969 /gnu/store/qbh16hfdv8pnfw01k6izbs3= jkji6i978-test-pkg-0.0/lib32/lib/libexpat.so -> /gnu/store/b0jns3vzhhpna7li= m8bc3dr0payzx5yy-expat-2.4.1/lib/libexpat.so* > lrwxrwxrwx 1 root root 73 Dec 31 1969 /gnu/store/qbh16hfdv8pnfw01k6izbs3= jkji6i978-test-pkg-0.0/lib32/lib/libexpat.so.1 -> /gnu/store/b0jns3vzhhpna7= lim8bc3dr0payzx5yy-expat-2.4.1/lib/libexpat.so.1* > lrwxrwxrwx 1 root root 77 Dec 31 1969 /gnu/store/qbh16hfdv8pnfw01k6izbs3= jkji6i978-test-pkg-0.0/lib32/lib/libexpat.so.1.8.1 -> /gnu/store/b0jns3vzhh= pna7lim8bc3dr0payzx5yy-expat-2.4.1/lib/libexpat.so.1.8.1* > > all the links are good and to the original (version 2.4.1) expat. In othe= r words, the constructed union64 and union32 inputs (in the sample code) do= not both get grafted, even though doing just the fhs-union command on it's= own (not building both for another package) does graft for either architec= ture. At least that seems like the most obvious difference between the earl= ier example and this new one. > > Why? Does the grafting just happen "once" somehow and misses the "same" i= nput again (but built for different system)? Is this expected or just a wei= rd/wrong way to do this kind of build which is causing this? I'm not sure i= f this is just with union-build or if it would happen just with inputs of t= he same library but different architectures. I didn't know how to do that q= uickly off hand, so I haven't tried it yet. Woow, it=E2=80=99s a sophisticated example. :-) I don=E2=80=99t actually have the Expat replacement we=E2=80=99re talking a= bout so I can=E2=80=99t easily test. At first sight I=E2=80=99d say it should work (both lib32 and lib64 should = refer to the Expat replacement), but it could be that something somewhere assumes all the packages are built for the system. That would need more investigation work in (guix packages) in (guix grafts). Thanks, Ludo=E2=80=99.