unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#23666: guix download fails for large files
@ 2016-05-31 19:56 Andreas Enge
  2016-05-31 20:26 ` Leo Famulari
  2016-06-01 12:39 ` Ludovic Courtès
  0 siblings, 2 replies; 5+ messages in thread
From: Andreas Enge @ 2016-05-31 19:56 UTC (permalink / raw)
  To: 23666

Hello,

since I am regularly rebuilding texlive (who is not!), I would like to keep
the source tarball on my machine, and whenever I garbage collect it from the
store, add it back via
   guix download file:texlive-20150523-texmf.tar.xz

On my Novena with a 32 bit processor and 4 GB of main memory, this fails with
   guix download: error: sendfile: Broken pipe

The file itself has 1,8 GB.

Downloading the file via http as part of "guix build" works, and
"guix download file:" also works on my x86_64 machine with 8 GB of RAM.

Andreas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23666: guix download fails for large files
  2016-05-31 19:56 bug#23666: guix download fails for large files Andreas Enge
@ 2016-05-31 20:26 ` Leo Famulari
  2016-06-01 12:39 ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Leo Famulari @ 2016-05-31 20:26 UTC (permalink / raw)
  To: Andreas Enge; +Cc: 23666

On Tue, May 31, 2016 at 09:56:31PM +0200, Andreas Enge wrote:
> since I am regularly rebuilding texlive (who is not!), I would like to keep
> the source tarball on my machine, and whenever I garbage collect it from the
> store, add it back via
>    guix download file:texlive-20150523-texmf.tar.xz
>
> On my Novena with a 32 bit processor and 4 GB of main memory, this fails with
>    guix download: error: sendfile: Broken pipe
> 
> The file itself has 1,8 GB.
> 
> Downloading the file via http as part of "guix build" works, and
> "guix download file:" also works on my x86_64 machine with 8 GB of RAM.

As a temporary workaround, you could make the tarball a gcroot:

# ln -sf /gnu/store/...-texlive-20150523-texmf.tar.xz \
/var/guix/gcroots/texlive-texmf.tar.xz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23666: guix download fails for large files
  2016-05-31 19:56 bug#23666: guix download fails for large files Andreas Enge
  2016-05-31 20:26 ` Leo Famulari
@ 2016-06-01 12:39 ` Ludovic Courtès
  2016-06-05 20:58   ` Andreas Enge
  1 sibling, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-06-01 12:39 UTC (permalink / raw)
  To: Andreas Enge; +Cc: 23666

Andreas Enge <andreas@enge.fr> skribis:

> On my Novena with a 32 bit processor and 4 GB of main memory, this fails with
>    guix download: error: sendfile: Broken pipe
>
> The file itself has 1,8 GB.

This is implemented using the ‘add-to-store’ RPC, which, after all these
years, is still implemented like this (nix/libstore/local-store.cc):

--8<---------------cut here---------------start------------->8---
Path LocalStore::addToStore(const string & name, const Path & _srcPath,
    bool recursive, HashType hashAlgo, PathFilter & filter, bool repair)
{
    Path srcPath(absPath(_srcPath));
    debug(format("adding `%1%' to the store") % srcPath);

    /* Read the whole path into memory. This is not a very scalable
       method for very large paths, but `copyPath' is mainly used for
       small files. */
--8<---------------cut here---------------end--------------->8---

This is undoubtedly what’s causing the failure.

Until this is fixed, you could wrap the file in a nar and import the nar
(nar import does not have this limitation, see ’LocalStore::importPath’
and co.).

To do that, you could do:

  guix archive --export $(guix build -S texlive-texmf-whatever) > t.nar

and later:

  guix archive --import < t.nar

HTH,
Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23666: guix download fails for large files
  2016-06-01 12:39 ` Ludovic Courtès
@ 2016-06-05 20:58   ` Andreas Enge
  2016-06-06  7:06     ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Enge @ 2016-06-05 20:58 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 23666

Thanks for your suggestions, Leo and Ludovic! I still see this as a bug;
should I report it upstream to Nix?

On Wed, Jun 01, 2016 at 02:39:54PM +0200, Ludovic Courtès wrote:
> This is implemented using the ‘add-to-store’ RPC, which, after all these
> years, is still implemented like this (nix/libstore/local-store.cc):
> 
> --8<---------------cut here---------------start------------->8---
> Path LocalStore::addToStore(const string & name, const Path & _srcPath,
>     bool recursive, HashType hashAlgo, PathFilter & filter, bool repair)
> {
>     Path srcPath(absPath(_srcPath));
>     debug(format("adding `%1%' to the store") % srcPath);
> 
>     /* Read the whole path into memory. This is not a very scalable
>        method for very large paths, but `copyPath' is mainly used for
>        small files. */
> --8<---------------cut here---------------end--------------->8---

Something that mainly does not fail could indeed be seen as a bug...
But how come that "guix download http://" succeeds, where
"guix download file://" fails?

Andreas

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#23666: guix download fails for large files
  2016-06-05 20:58   ` Andreas Enge
@ 2016-06-06  7:06     ` Ludovic Courtès
  0 siblings, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2016-06-06  7:06 UTC (permalink / raw)
  To: Andreas Enge; +Cc: 23666

Andreas Enge <andreas@enge.fr> skribis:

> On Wed, Jun 01, 2016 at 02:39:54PM +0200, Ludovic Courtès wrote:
>> This is implemented using the ‘add-to-store’ RPC, which, after all these
>> years, is still implemented like this (nix/libstore/local-store.cc):
>> 
>> --8<---------------cut here---------------start------------->8---
>> Path LocalStore::addToStore(const string & name, const Path & _srcPath,
>>     bool recursive, HashType hashAlgo, PathFilter & filter, bool repair)
>> {
>>     Path srcPath(absPath(_srcPath));
>>     debug(format("adding `%1%' to the store") % srcPath);
>> 
>>     /* Read the whole path into memory. This is not a very scalable
>>        method for very large paths, but `copyPath' is mainly used for
>>        small files. */
>> --8<---------------cut here---------------end--------------->8---
>
> Something that mainly does not fail could indeed be seen as a bug...
> But how come that "guix download http://" succeeds, where
> "guix download file://" fails?

Both use the ‘add-to-store’ RPC, so both have equal chances of failing.

Note that, fortunately, fixed-output derivations (‘guix build -S foo’)
do not use ‘add-to-store’.  In general, except in the case of ‘guix
download’, ‘add-to-store’ is only used with small files like when adding
.scm files to the store, etc.

Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-06  7:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-31 19:56 bug#23666: guix download fails for large files Andreas Enge
2016-05-31 20:26 ` Leo Famulari
2016-06-01 12:39 ` Ludovic Courtès
2016-06-05 20:58   ` Andreas Enge
2016-06-06  7:06     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).