unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: Attempt to 'get-bytevector-n!' from directory in union.scm?
Date: Sun, 09 Feb 2014 22:00:07 +0100	[thread overview]
Message-ID: <871tzcgfxk.fsf@gnu.org> (raw)
In-Reply-To: <8738js4ket.fsf@netris.org> (Mark H. Weaver's message of "Sun, 09 Feb 2014 06:04:10 -0500")

[-- Attachment #1: Type: text/plain, Size: 1681 bytes --]

Mark H Weaver <mhw@netris.org> 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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1159 bytes --]

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)))

[-- Attachment #3: Type: text/plain, Size: 227 bytes --]


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	other threads:[~2014-02-09 21:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-09 11:04 Attempt to 'get-bytevector-n!' from directory in union.scm? Mark H Weaver
2014-02-09 21:00 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871tzcgfxk.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).