guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Attempt to 'get-bytevector-n!' from directory in union.scm?


From: Ludovic Courtès
Subject: Re: Attempt to 'get-bytevector-n!' from directory in union.scm?
Date: Sun, 09 Feb 2014 22:00:07 +0100
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Mark H Weaver <address@hidden> skribis:

> In 
> /nix/store/n670kdk9ysi9jlq3f6ki4glc34p35dc1-module-import/guix/build/union.scm:
>  202: 9 [union-build "/nix/store/dn29z8fpkh33sxgwwbxg0cn7ih523v65-profile" # 
> # ...]
>  102: 8 [loop #]
> In srfi/srfi-1.scm:
>  578: 7 [map #<procedure loop (tree)> (# # # # ...)]
> In 
> /nix/store/n670kdk9ysi9jlq3f6ki4glc34p35dc1-module-import/guix/build/union.scm:
>  101: 6 [loop #]
> In srfi/srfi-1.scm:
>  578: 5 [map #<procedure resolve-collision (leaves)> (# # # # ...)]
> In 
> /nix/store/n670kdk9ysi9jlq3f6ki4glc34p35dc1-module-import/guix/build/union.scm:
>  187: 4 [resolve-collision #]
> In ice-9/boot-9.scm:
>  793: 3 [call-with-input-file 
> "/nix/store/25mp69n6i16b308sbyh42ic3qzld46li-ncurses-5.9/lib/terminfo" ...]
>  793: 2 [call-with-input-file 
> "/nix/store/y9q8dwgs8lxww2khkk1hfji1jihkfcz3-ncurses-5.9/lib/terminfo" ...]
> In 
> /nix/store/n670kdk9ysi9jlq3f6ki4glc34p35dc1-module-import/guix/build/union.scm:
>  116: 1 [#<procedure 10469fb0 at 
> /nix/store/n670kdk9ysi9jlq3f6ki4glc34p35dc1-module-import/guix/build/union.scm:111:13
>  (port2)> #<input: 
> /nix/store/y9q8dwgs8lxww2khkk1hfji1jihkfcz3-ncurses-5.9/lib/terminfo 7>]
> In unknown file:
>    ?: 0 [get-bytevector-n! #<input: 
> /nix/store/25mp69n6i16b308sbyh42ic3qzld46li-ncurses-5.9/lib/terminfo 6> ...]
>
> ERROR: In procedure get-bytevector-n!:
> ERROR: In procedure fport_fill_input: Is a directory

The ‘lib/terminfo’ directory is apparently provided by two or more
packages, so there’s a collision, leading to a ‘resolve-collision’ call,
which in turns call ‘file=?’, which is not prepared to deal with
directories.

This patch should fix it:

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)))
However, could you check which are the colliding packages?  Readline
doesn’t have lib/terminfo here.  Or perhaps ‘guix package’ is wrongfully
trying to keep two copies of ncurses in the profile?

Thanks,
Ludo’.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]