From 829af22759b8a99c3b44697365390a945f3acc04 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 10 Jun 2014 13:30:09 +0200 Subject: 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. --- src/libstore/remote-store.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libstore') diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 461920693..177b8e7af 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); } -- cgit v1.2.3