From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Invalid nar signature Date: Tue, 16 Dec 2014 18:07:10 +0100 Message-ID: <871tnz8qwx.fsf@gnu.org> References: <87zjapejo3.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87ppbkompf.fsf@gnu.org> <87ppbkfw4w.fsf@gnu.org> <87ppbkedf2.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0vaf-0004nT-A6 for guix-devel@gnu.org; Tue, 16 Dec 2014 12:07:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0vaa-0005Kk-I0 for guix-devel@gnu.org; Tue, 16 Dec 2014 12:07:17 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:49864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0vaa-0005KJ-Be for guix-devel@gnu.org; Tue, 16 Dec 2014 12:07:12 -0500 In-Reply-To: <87ppbkedf2.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (David Thompson's message of "Mon, 15 Dec 2014 17:49:53 -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: David Thompson Cc: guix-devel David Thompson skribis: > Ludovic Court=C3=A8s writes: > >> To produce that, use =E2=80=98write-file=E2=80=99 from (guix serializati= on): >> >> --8<---------------cut here---------------start------------->8--- >> $ ./pre-inst-env guile -c '(use-modules (guix serialization)) (write-fil= e "/gnu/store/wy70n5zk8qinxjz0wdk9q2hh1zjfb32j-miscfiles-1.5" (current-outp= ut-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 =E2=80=98x=E2=80=99 in =E2=80=98restore-file=E2= =80=99 at the point where the exception is raised. 2. strace the substituter and/or =E2=80=98guix publish=E2=80=99 to see ex= actly what happens on the wire. Is the end-of-file marker string sent? Is it received? etc. Ludo=E2=80=99.