From unknown Tue Aug 12 08:32:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#17083: =?UTF-8?Q?=E2=80=98union-build=E2=80=99?= does not handle collisions between a leaf and a sub-tree Resent-From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 24 Mar 2014 14:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 17083 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: mhw@netris.org, 17083@debbugs.gnu.org Cc: guix-devel@gnu.org X-Debbugs-Original-To: Mark H Weaver , bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.139567056013576 (code B ref -1); Mon, 24 Mar 2014 14:16:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Mar 2014 14:16:00 +0000 Received: from localhost ([127.0.0.1]:47710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WS5fU-0003Wt-0d for submit@debbugs.gnu.org; Mon, 24 Mar 2014 10:16:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36515) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WS5fR-0003Wj-EN for submit@debbugs.gnu.org; Mon, 24 Mar 2014 10:15:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS5fJ-0000P9-Lm for submit@debbugs.gnu.org; Mon, 24 Mar 2014 10:15:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5fJ-0000P1-G2 for submit@debbugs.gnu.org; Mon, 24 Mar 2014 10:15:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5fD-0001Ci-Dz for bug-guix@gnu.org; Mon, 24 Mar 2014 10:15:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS5f7-0000Mu-Fn for bug-guix@gnu.org; Mon, 24 Mar 2014 10:15:43 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:46232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5f6-0000MK-Gu; Mon, 24 Mar 2014 10:15:37 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 104D62036; Mon, 24 Mar 2014 15:15:35 +0100 (CET) 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 CRXDTV4K8Z2M; Mon, 24 Mar 2014 15:15:34 +0100 (CET) Received: from pluto (pluto.bordeaux.inria.fr [193.50.110.57]) by hera.aquilenet.fr (Postfix) with ESMTPSA id CA8492020; Mon, 24 Mar 2014 15:15:34 +0100 (CET) From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <87ior4ku41.fsf@yeeloong.lan> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 Germinal an 222 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 24 Mar 2014 15:15:34 +0100 In-Reply-To: <87ior4ku41.fsf@yeeloong.lan> (Mark H. Weaver's message of "Mon, 24 Mar 2014 02:07:10 -0400") Message-ID: <87siq7y96h.fsf@gnu.org> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.5 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.5 (-----) (Adding bug-guix.) Mark H Weaver skribis: > On the Loongson 3A machine, I finished building all the packages from > core-updates that I use in my profile, and then tried installing them. > I got this: > > In /gnu/store/9sqx55rgygyrcyg350cfqwy8wqb4fr69-module-import/guix/build/u= nion.scm: > 226: 1 [loop # #] > In unknown file: > ?: 0 [mkdir "/gnu/store/c30bsax58scw5qwcnbma16k6z88s1lh3-profile/./inc= lude" ...] > > ERROR: In procedure mkdir: > ERROR: In procedure mkdir: File exists > builder for `/gnu/store/17w6kggffh79drmmrdnxy1yhgr6p2in5-profile.drv' fai= led with exit code 1 > > The problem turns out to be that 'libffi' makes 'include' a symlink to > 'lib/libffi-3.0.13/include', and union.scm cannot cope with conflicts > between a directory and a symlink. Ouch, good catch. I=E2=80=99ve come up with a test that reproduces it: --8<---------------cut here---------------start------------->8--- (test-assert "union-build with symlink to directory" (let* ((builder '(begin (use-modules (guix build union) (guix build utils) (srfi srfi-26)) (mkdir-p "one/foo") (call-with-output-file "one/foo/one" (cut display "one" <>)) (mkdir-p "two/bar") (symlink "bar" "two/foo") (call-with-output-file "two/foo/two" (cut display "two" <>)) (union-build (assoc-ref %outputs "out") '("one" "two")= ))) (drv (build-expression->derivation %store "union-collision-symlink" builder #:modules '((guix build union) (guix build utils))))) (and (build-derivations %store (list drv)) (with-directory-excursion (derivation->output-path drv) (and (file-exists? "one/foo/one") (file-exists? "two/foo/two") (file-exists? "two/bar/two")))))) --8<---------------cut here---------------end--------------->8--- Actually union.scm cannot handle collisions between a leaf and a directory in general, which should be fixed. I can think of these cases: 1. If the leaf is a regular file, error out. 2. If the leaf is a symlink: a. If it points to a directory, union the directories. b. Otherwise, error out. Does that make sense? Do you think you could come up with a patch? Alternately we could apply Sree=E2=80=99s proposed workaround as a stopgap measure. Thanks, Ludo=E2=80=99. From unknown Tue Aug 12 08:32:34 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#17083: closed (Re: bug#17083: =?UTF-8?Q?=E2=80=98union-build=E2=80=99?= does not handle collisions between a leaf and a sub-tree) Message-ID: References: <87ioqrflv4.fsf@gnu.org> <87siq7y96h.fsf@gnu.org> X-Gnu-PR-Message: they-closed 17083 X-Gnu-PR-Package: guix Reply-To: 17083@debbugs.gnu.org Date: Wed, 02 Apr 2014 21:44:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1396475043-29255-1" This is a multi-part message in MIME format... ------------=_1396475043-29255-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #17083: =E2=80=98union-build=E2=80=99 does not handle collisions between a = leaf and a sub-tree which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 17083@debbugs.gnu.org. --=20 17083: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D17083 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1396475043-29255-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 17083-done) by debbugs.gnu.org; 2 Apr 2014 21:43:50 +0000 Received: from localhost ([127.0.0.1]:33409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVSwo-0007bJ-67 for submit@debbugs.gnu.org; Wed, 02 Apr 2014 17:43:50 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:59227) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WVSwk-0007b9-Ox for 17083-done@debbugs.gnu.org; Wed, 02 Apr 2014 17:43:47 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id DD33A2180; Wed, 2 Apr 2014 23:43:44 +0200 (CEST) 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 nS+9soHn76KP; Wed, 2 Apr 2014 23:43:44 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 791F21E1A; Wed, 2 Apr 2014 23:43:44 +0200 (CEST) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: mhw@netris.org Subject: Re: bug#17083: =?utf-8?Q?=E2=80=98union-build=E2=80=99?= does not handle collisions between a leaf and a sub-tree References: <87ior4ku41.fsf@yeeloong.lan> <87siq7y96h.fsf@gnu.org> Date: Wed, 02 Apr 2014 23:43:43 +0200 In-Reply-To: <87siq7y96h.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 24 Mar 2014 15:15:34 +0100") Message-ID: <87ioqrflv4.fsf@gnu.org> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 17083-done Cc: 17083-done@debbugs.gnu.org, guix-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: 1.0 (+) ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Mark H Weaver skribis: > >> On the Loongson 3A machine, I finished building all the packages from >> core-updates that I use in my profile, and then tried installing them. >> I got this: >> >> In /gnu/store/9sqx55rgygyrcyg350cfqwy8wqb4fr69-module-import/guix/build/= union.scm: >> 226: 1 [loop # #] >> In unknown file: >> ?: 0 [mkdir "/gnu/store/c30bsax58scw5qwcnbma16k6z88s1lh3-profile/./in= clude" ...] >> >> ERROR: In procedure mkdir: >> ERROR: In procedure mkdir: File exists >> builder for `/gnu/store/17w6kggffh79drmmrdnxy1yhgr6p2in5-profile.drv' fa= iled with exit code 1 >> >> The problem turns out to be that 'libffi' makes 'include' a symlink to >> 'lib/libffi-3.0.13/include', and union.scm cannot cope with conflicts >> between a directory and a symlink. > > Ouch, good catch. This is fixed with the new union.scm (commit 1212999.) > I=E2=80=99ve come up with a test that reproduces it: This test was actually bogus, so I committed a correct one (commit a53a9ae.) Thanks! Ludo=E2=80=99. ------------=_1396475043-29255-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 24 Mar 2014 14:16:00 +0000 Received: from localhost ([127.0.0.1]:47710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WS5fU-0003Wt-0d for submit@debbugs.gnu.org; Mon, 24 Mar 2014 10:16:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36515) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WS5fR-0003Wj-EN for submit@debbugs.gnu.org; Mon, 24 Mar 2014 10:15:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS5fJ-0000P9-Lm for submit@debbugs.gnu.org; Mon, 24 Mar 2014 10:15:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:47723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5fJ-0000P1-G2 for submit@debbugs.gnu.org; Mon, 24 Mar 2014 10:15:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5fD-0001Ci-Dz for bug-guix@gnu.org; Mon, 24 Mar 2014 10:15:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WS5f7-0000Mu-Fn for bug-guix@gnu.org; Mon, 24 Mar 2014 10:15:43 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:46232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WS5f6-0000MK-Gu; Mon, 24 Mar 2014 10:15:37 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 104D62036; Mon, 24 Mar 2014 15:15:35 +0100 (CET) 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 CRXDTV4K8Z2M; Mon, 24 Mar 2014 15:15:34 +0100 (CET) Received: from pluto (pluto.bordeaux.inria.fr [193.50.110.57]) by hera.aquilenet.fr (Postfix) with ESMTPSA id CA8492020; Mon, 24 Mar 2014 15:15:34 +0100 (CET) From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) To: Mark H Weaver , bug-guix@gnu.org Subject: =?utf-8?Q?=E2=80=98union-build=E2=80=99?= does not handle collisions between a leaf and a sub-tree References: <87ior4ku41.fsf@yeeloong.lan> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 Germinal an 222 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu Date: Mon, 24 Mar 2014 15:15:34 +0100 In-Reply-To: <87ior4ku41.fsf@yeeloong.lan> (Mark H. Weaver's message of "Mon, 24 Mar 2014 02:07:10 -0400") Message-ID: <87siq7y96h.fsf@gnu.org> User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: submit Cc: guix-devel@gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.5 (-----) (Adding bug-guix.) Mark H Weaver skribis: > On the Loongson 3A machine, I finished building all the packages from > core-updates that I use in my profile, and then tried installing them. > I got this: > > In /gnu/store/9sqx55rgygyrcyg350cfqwy8wqb4fr69-module-import/guix/build/u= nion.scm: > 226: 1 [loop # #] > In unknown file: > ?: 0 [mkdir "/gnu/store/c30bsax58scw5qwcnbma16k6z88s1lh3-profile/./inc= lude" ...] > > ERROR: In procedure mkdir: > ERROR: In procedure mkdir: File exists > builder for `/gnu/store/17w6kggffh79drmmrdnxy1yhgr6p2in5-profile.drv' fai= led with exit code 1 > > The problem turns out to be that 'libffi' makes 'include' a symlink to > 'lib/libffi-3.0.13/include', and union.scm cannot cope with conflicts > between a directory and a symlink. Ouch, good catch. I=E2=80=99ve come up with a test that reproduces it: --8<---------------cut here---------------start------------->8--- (test-assert "union-build with symlink to directory" (let* ((builder '(begin (use-modules (guix build union) (guix build utils) (srfi srfi-26)) (mkdir-p "one/foo") (call-with-output-file "one/foo/one" (cut display "one" <>)) (mkdir-p "two/bar") (symlink "bar" "two/foo") (call-with-output-file "two/foo/two" (cut display "two" <>)) (union-build (assoc-ref %outputs "out") '("one" "two")= ))) (drv (build-expression->derivation %store "union-collision-symlink" builder #:modules '((guix build union) (guix build utils))))) (and (build-derivations %store (list drv)) (with-directory-excursion (derivation->output-path drv) (and (file-exists? "one/foo/one") (file-exists? "two/foo/two") (file-exists? "two/bar/two")))))) --8<---------------cut here---------------end--------------->8--- Actually union.scm cannot handle collisions between a leaf and a directory in general, which should be fixed. I can think of these cases: 1. If the leaf is a regular file, error out. 2. If the leaf is a symlink: a. If it points to a directory, union the directories. b. Otherwise, error out. Does that make sense? Do you think you could come up with a patch? Alternately we could apply Sree=E2=80=99s proposed workaround as a stopgap measure. Thanks, Ludo=E2=80=99. ------------=_1396475043-29255-1--