summary refs log tree commit diff
path: root/nix/nix-daemon/nix-daemon.cc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-11-24 15:59:26 +0100
committerLudovic Courtès <ludo@gnu.org>2018-11-24 19:52:16 +0100
commitbb640d6133dea0ede7e80db9ca64a9b2e451317a (patch)
treef2c9e50f3e8d9e65d8a156072e23079f9955da3e /nix/nix-daemon/nix-daemon.cc
parent1b3083267cbacc9ef48bbc9ff95864065894b082 (diff)
downloadguix-bb640d6133dea0ede7e80db9ca64a9b2e451317a.tar.gz
daemon: Ignore '--keep-failed' for TCP/IP clients.
* nix/nix-daemon/nix-daemon.cc (performOp) <wopSetOptions>: When
'isRemoteConnection' is true, set 'settings.keepFailed' to zero.
* doc/guix.texi (Common Build Options): Document this behavior.
Diffstat (limited to 'nix/nix-daemon/nix-daemon.cc')
-rw-r--r--nix/nix-daemon/nix-daemon.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/nix/nix-daemon/nix-daemon.cc b/nix/nix-daemon/nix-daemon.cc
index 2939422172..6ce475a26c 100644
--- a/nix/nix-daemon/nix-daemon.cc
+++ b/nix/nix-daemon/nix-daemon.cc
@@ -565,6 +565,12 @@ static void performOp(bool trusted, unsigned int clientVersion,
 
     case wopSetOptions: {
         settings.keepFailed = readInt(from) != 0;
+	if (isRemoteConnection)
+	    /* When the client is remote, don't keep the failed build tree as
+	       it is presumably inaccessible to the client and could fill up
+	       our disk.  */
+	    settings.keepFailed = 0;
+
         settings.keepGoing = readInt(from) != 0;
         settings.set("build-fallback", readInt(from) ? "true" : "false");
         verbosity = (Verbosity) readInt(from);