about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2018-01-10T10·31+0100
committerGitHub <noreply@github.com>2018-01-10T10·31+0100
commit874ad7d9f86e28c6f12bba5fa1af50d2a86935d8 (patch)
tree2105096d5bbc526e1cf61884ede031fa85e5d30c /src
parent3cd0704387eb10c4104ba06309ed38a6670b5660 (diff)
parentb0328c244dd15da9e45f4e95d900c81fe0c47dda (diff)
Merge pull request #1788 from k0001/rem-subs-1
nix.conf: builders-use-substitutes
Diffstat (limited to 'src')
-rw-r--r--src/build-remote/build-remote.cc6
-rw-r--r--src/libstore/globals.hh5
2 files changed, 9 insertions, 2 deletions
diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc
index 445006b327fd..df579729af29 100644
--- a/src/build-remote/build-remote.cc
+++ b/src/build-remote/build-remote.cc
@@ -218,9 +218,11 @@ connected:
             signal(SIGALRM, old);
         }
 
+        auto substitute = settings.buildersUseSubstitutes ? Substitute : NoSubstitute;
+
         {
             Activity act(*logger, lvlTalkative, actUnknown, fmt("copying dependencies to '%s'", storeUri));
-            copyPaths(store, ref<Store>(sshStore), inputs, NoRepair, NoCheckSigs);
+            copyPaths(store, ref<Store>(sshStore), inputs, NoRepair, NoCheckSigs, substitute);
         }
 
         uploadLock = -1;
@@ -240,7 +242,7 @@ connected:
         if (!missing.empty()) {
             Activity act(*logger, lvlTalkative, actUnknown, fmt("copying outputs from '%s'", storeUri));
             setenv("NIX_HELD_LOCKS", concatStringsSep(" ", missing).c_str(), 1); /* FIXME: ugly */
-            copyPaths(ref<Store>(sshStore), store, missing, NoRepair, NoCheckSigs);
+            copyPaths(ref<Store>(sshStore), store, missing, NoRepair, NoCheckSigs, substitute);
         }
 
         return;
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index ae4b78a018e0..af72f7b1e35d 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -138,6 +138,11 @@ public:
     Setting<std::string> builders{this, "@" + nixConfDir + "/machines", "builders",
         "A semicolon-separated list of build machines, in the format of nix.machines."};
 
+    Setting<bool> buildersUseSubstitutes{this, false, "builders-use-substitutes",
+        "Whether build machines should use their own substitutes for obtaining "
+        "build dependencies if possible, rather than waiting for this host to "
+        "upload them."};
+
     Setting<off_t> reservedSize{this, 8 * 1024 * 1024, "gc-reserved-space",
         "Amount of reserved disk space for the garbage collector."};