about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-06-10T11·30+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-06-10T11·30+0200
commit829af22759b8a99c3b44697365390a945f3acc04 (patch)
tree0968e63ada2198f354621101b0cf3c6b79684d6c /src/libstore
parent3c6b8a521561f5341652ffe37b869d5ab457227b (diff)
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.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/remote-store.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 461920693290..177b8e7afdfd 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -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);
 }