From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Corrupt input while restoring file Date: Sat, 14 Mar 2015 15:00:47 +0100 Message-ID: <87egorznjk.fsf@gnu.org> References: <87h9tp3d9e.fsf@fsf.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]:48489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWmcZ-0000rg-5s for guix-devel@gnu.org; Sat, 14 Mar 2015 10:00:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWmcV-00088K-T4 for guix-devel@gnu.org; Sat, 14 Mar 2015 10:00:55 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:55025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWmcV-00088G-Pi for guix-devel@gnu.org; Sat, 14 Mar 2015 10:00:51 -0400 In-Reply-To: <87h9tp3d9e.fsf@fsf.org> (David Thompson's message of "Thu, 12 Mar 2015 21:19:25 -0400") 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@gnu.org David Thompson skribis: > Take this for example: > > guix substitute-binary --substitute /gnu/store/z8kf6hgln4a7xf68pdnlib= l3vcg5rl15-ruby-2.2.1 /tmp/foobar > > This store item is 39.7MiB uncompressed, but Guix tries to read a 162MiB > file out of it! Please check the file /var/guix/substitute-binary/cache/z8kf6hgln4a7xf68pdnlibl3vcg5rl15. It should contain the raw narinfo produced by =E2=80=98guix publish=E2=80=99. = Is it correct? If not, you can remove that file and do a query to repopulate it (like =E2=80=98guix build ruby -n=E2=80=99, which leads to the daemon invoking = =E2=80=98guix substitute-binary --query=E2=80=99.) The narinfo has a =E2=80=98NarSize=E2=80=99 field, which gets map to what t= he =E2=80=98narinfo-size=E2=80=99 procedure in (guix scripts substitute-binary= ) returns. This is the expected size of the .nar, uncompressed: (format (current-error-port) "downloading `~a'~:[~*~; (~,1f MiB installed= )~]...~%" store-path ;; Use the Nar size as an estimate of the installed size. (narinfo-size narinfo) (and=3D> (narinfo-size narinfo) (cute / <> (expt 2. 20)))) (The actual size of the data being downloaded is smaller or equal to the nar size, due to compression; the installed size is typically greater.) > 331: 7 [restore-file #= "/tmp/foobar"] > 365: 6 [restore "/tmp/foobar"] > 365: 5 [restore "/tmp/foobar/bin"] > 333: 4 [restore "/tmp/foobar/bin/irb"] This suggests that the nar is properly decoded so far. > 127: 3 [read-string #] > 119: 2 [read-byte-string #] > 78: 1 [get-bytevector-n* # ...] > In unknown file: > ?: 0 [scm-error misc-error #f "~A" ("foo") #f] So where does this =E2=80=98error=E2=80=99 call come from? What does =E2= =80=98read-contents=E2=80=99 sees for the =E2=80=98irb=E2=80=99 file, namely the =E2=80=98executable?=E2= =80=99 and =E2=80=98size=E2=80=99 variables? Thanks, Ludo=E2=80=99.