Print a warning when loading a large path into memory

I.e. if you have a derivation with

  src = ./huge-directory;

you'll get a warning that this is not a good idea.
This commit is contained in:
Eelco Dolstra 2014-06-10 13:30:09 +02:00
parent 3c6b8a5215
commit 829af22759
3 changed files with 33 additions and 4 deletions

View file

@ -402,7 +402,10 @@ Path RemoteStore::addToStore(const Path & _srcPath,
writeInt((hashAlgo == htSHA256 && recursive) ? 0 : 1, to);
writeInt(recursive ? 1 : 0, to);
writeString(printHashType(hashAlgo), to);
to.written = 0;
to.warn = true;
dumpPath(srcPath, to, filter);
to.warn = false;
processStderr();
return readStorePath(from);
}