From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Attempt to 'get-bytevector-n!' from directory in union.scm? Date: Sun, 09 Feb 2014 22:00:07 +0100 Message-ID: <871tzcgfxk.fsf@gnu.org> References: <8738js4ket.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCbU8-0002gQ-8v for guix-devel@gnu.org; Sun, 09 Feb 2014 16:00:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCbU2-0007tp-F7 for guix-devel@gnu.org; Sun, 09 Feb 2014 16:00:16 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:40125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCbU2-0007tW-4P for guix-devel@gnu.org; Sun, 09 Feb 2014 16:00:10 -0500 In-Reply-To: <8738js4ket.fsf@netris.org> (Mark H. Weaver's message of "Sun, 09 Feb 2014 06:04:10 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mark H Weaver Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mark H Weaver skribis: > In /nix/store/n670kdk9ysi9jlq3f6ki4glc34p35dc1-module-import/guix/build/u= nion.scm: > 202: 9 [union-build "/nix/store/dn29z8fpkh33sxgwwbxg0cn7ih523v65-profile= " # # ...] > 102: 8 [loop #] > In srfi/srfi-1.scm: > 578: 7 [map # (# # # # ...)] > In /nix/store/n670kdk9ysi9jlq3f6ki4glc34p35dc1-module-import/guix/build/u= nion.scm: > 101: 6 [loop #] > In srfi/srfi-1.scm: > 578: 5 [map # (# # # # ...)] > In /nix/store/n670kdk9ysi9jlq3f6ki4glc34p35dc1-module-import/guix/build/u= nion.scm: > 187: 4 [resolve-collision #] > In ice-9/boot-9.scm: > 793: 3 [call-with-input-file "/nix/store/25mp69n6i16b308sbyh42ic3qzld46l= i-ncurses-5.9/lib/terminfo" ...] > 793: 2 [call-with-input-file "/nix/store/y9q8dwgs8lxww2khkk1hfji1jihkfcz= 3-ncurses-5.9/lib/terminfo" ...] > In /nix/store/n670kdk9ysi9jlq3f6ki4glc34p35dc1-module-import/guix/build/u= nion.scm: > 116: 1 [# #] > In unknown file: > ?: 0 [get-bytevector-n! # ...] > > ERROR: In procedure get-bytevector-n!: > ERROR: In procedure fport_fill_input: Is a directory The =E2=80=98lib/terminfo=E2=80=99 directory is apparently provided by two = or more packages, so there=E2=80=99s a collision, leading to a =E2=80=98resolve-col= lision=E2=80=99 call, which in turns call =E2=80=98file=3D?=E2=80=99, which is not prepared to de= al with directories. This patch should fix it: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/build/union.scm b/guix/build/union.scm index 1b09da4..6e2b296 100644 --- a/guix/build/union.scm +++ b/guix/build/union.scm @@ -103,8 +103,13 @@ single leaf." (leaf leaf)))) (define (file=? file1 file2) - "Return #t if the contents of FILE1 and FILE2 are identical, #f otherwise." - (and (= (stat:size (stat file1)) (stat:size (stat file2))) + "Return #t if FILE1 and FILE2 are regular files and their contents are +identical, #f otherwise." + (let ((st1 (stat file1)) + (st2 (stat file2))) + (and (eq? (stat:type st1) 'regular) + (eq? (stat:type st2) 'regular) + (= (stat:size st1) (stat:size st2)) (call-with-input-file file1 (lambda (port1) (call-with-input-file file2 @@ -117,7 +122,7 @@ single leaf." (n2 (get-bytevector-n! port2 buf2 0 len))) (and (equal? n1 n2) (or (eof-object? n1) - (loop))))))))))) + (loop)))))))))))) (define* (union-build output directories #:key (log-port (current-error-port))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable However, could you check which are the colliding packages? Readline doesn=E2=80=99t have lib/terminfo here. Or perhaps =E2=80=98guix package= =E2=80=99 is wrongfully trying to keep two copies of ncurses in the profile? Thanks, Ludo=E2=80=99. --=-=-=--