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: Mon, 15 Dec 2014 22:20:15 +0100 Message-ID: <87ppbkfw4w.fsf@gnu.org> References: <87zjapejo3.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <87ppbkompf.fsf@gnu.org> 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]:41791) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0d43-0005lF-2x for guix-devel@gnu.org; Mon, 15 Dec 2014 16:20:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0d3y-0007Xd-Ae for guix-devel@gnu.org; Mon, 15 Dec 2014 16:20:23 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:49087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0d3y-0007Vr-42 for guix-devel@gnu.org; Mon, 15 Dec 2014 16:20:18 -0500 In-Reply-To: (David Thompson's message of "Mon, 15 Dec 2014 15:08: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: "Thompson, David" Cc: guix-devel "Thompson, David" skribis: > On Mon, Dec 15, 2014 at 12:19 PM, Ludovic Court=C3=A8s wro= te: >> I think this is due to a subtly misleading file format variation. >> >> If you look at =E2=80=98export-paths=E2=80=99, it does: >> >> while there are files to write >> write-long-long 1 >> export-path file >> write-long-long 0 >> >> =E2=80=98restore-file-set=E2=80=99 does the opposite, which is to read t= hat long-long to >> determine whether there=E2=80=99s data coming up, and then to call >> =E2=80=98restore-file=E2=80=99. > > Thanks. I'm still a little confused, though. I'm not sure what > change I need to make in order to satisfy the substituter. Do I need > to write a variant of export-paths that leaves off the initial > write-long-long call? For illustration purposes, here=E2=80=99s a normal sequence: --8<---------------cut here---------------start------------->8--- $ wget -O t.nar.bz2 http://hydra.gnu.org/nar/wy70n5zk8qinxjz0wdk9q2hh1zjfb3= 2j-miscfiles-1.5 $ bunzip2 t.nar.bz2=20 $ ./pre-inst-env guile -c '(use-modules (guix serialization)) (call-with-in= put-file "t.nar" (lambda (port) (restore-file port "restored")))' $ ls restored/ share --8<---------------cut here---------------end--------------->8--- =E2=80=98restore-file=E2=80=99 is what =E2=80=98guix substitute-binary --su= bstitute=E2=80=99 uses. It expects a single store item=E2=80=93i.e., the variant /without/ the leading long-long, as you noticed. To produce that, use =E2=80=98write-file=E2=80=99 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-in= put-file "t.nar" (lambda (port) (restore-file port "restored")))' $ ls restored/ share --8<---------------cut here---------------end--------------->8--- Sorry for the confusion! Ludo=E2=80=99.