guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Corrupt input while restoring file


From: Ludovic Courtès
Subject: Re: Corrupt input while restoring file
Date: Sat, 14 Mar 2015 15:00:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

David Thompson <address@hidden> skribis:

> Take this for example:
>
>     guix substitute-binary --substitute 
> /gnu/store/z8kf6hgln4a7xf68pdnlibl3vcg5rl15-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 ‘guix publish’.  Is it
correct?

If not, you can remove that file and do a query to repopulate it (like
‘guix build ruby -n’, which leads to the daemon invoking ‘guix
substitute-binary --query’.)

The narinfo has a ‘NarSize’ field, which gets map to what the
‘narinfo-size’ 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=> (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 #<input: r6rs-custom-binary-input-port 16ab820> 
> "/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 #<input: r6rs-custom-binary-input-port 16ab820>]
>      119: 2 [read-byte-string #<input: r6rs-custom-binary-input-port 16ab820>]
>       78: 1 [get-bytevector-n* #<input: r6rs-custom-binary-input-port 
> 16ab820> ...]
>     In unknown file:
>        ?: 0 [scm-error misc-error #f "~A" ("foo") #f]

So where does this ‘error’ call come from?  What does ‘read-contents’
sees for the ‘irb’ file, namely the ‘executable?’ and ‘size’ variables?

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]