[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Invalid nar signature
From: |
Ludovic Courtès |
Subject: |
Re: Invalid nar signature |
Date: |
Tue, 16 Dec 2014 18:07:10 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
David Thompson <address@hidden> skribis:
> Ludovic Courtès <address@hidden> writes:
>
>> To produce that, use ‘write-file’ from (guix serialization):
>>
>> --8<---------------cut here---------------start------------->8---
>> $ ./pre-inst-env guile -c '(use-modules (guix serialization)) (write-file
>> "/gnu/store/wy70n5zk8qinxjz0wdk9q2hh1zjfb32j-miscfiles-1.5"
>> (current-output-port))' > t.nar
>> $ ./pre-inst-env guile -c '(use-modules (guix serialization))
>> (call-with-input-file "t.nar" (lambda (port) (restore-file port
>> "restored")))'
>> $ ls restored/
>> share
>> --8<---------------cut here---------------end--------------->8---
>
> The above snippet works. However, 'guix substitute-binary' throws the
> following error:
>
> guix substitute-binary: error: invalid nar end-of-file marker
>
> Here's my nar rendering code:
>
> (define (render-nar store-item)
> "Render archive of the store path corresponding to STORE-ITEM."
> (let ((store-path (string-append %store-directory "/" store-item)))
> (values '((content-type . (text/x-nix-archive)))
> (lambda (port)
> (write-file store-path port)))))
Hmm, some ideas of things to try:
1. Add (force-output port) after (write-file ...).
2. Display the value of ‘x’ in ‘restore-file’ at the point where the
exception is raised.
2. strace the substituter and/or ‘guix publish’ to see exactly what
happens on the wire. Is the end-of-file marker string sent? Is it
received? etc.
Ludo’.