diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-04-30 19:15:34 -0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-04-30 19:15:34 -0400 |
commit | db5b86ef13026d7f034527005ab231ddc2b7d2c1 (patch) | |
tree | 590c3761e9d3cfae634a81fb80cc47659666941d /src/libstore | |
parent | 59a26360c75f1cf5fe65fce5e3703df0b6645140 (diff) |
* Add an option ‘build-use-substitutes’, which can be set to ‘false’
to disable use of substitutes; i.e., force building from source.
Fixes Nix/221.
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/build.cc | 2 | ||||
-rw-r--r-- | src/libstore/misc.cc | 4 | ||||
-rw-r--r-- | src/libstore/remote-store.cc | 3 | ||||
-rw-r--r-- | src/libstore/worker-protocol.hh | 2 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index acc292305..789a7f617 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -962,7 +962,7 @@ void DerivationGoal::haveDerivation() foreach (PathSet::iterator, i, invalidOutputs) /* Don't bother creating a substitution goal if there are no substitutes. */ - if (worker.store.hasSubstitutes(*i)) + if (queryBoolSetting("build-use-substitutes", true) && worker.store.hasSubstitutes(*i)) addWaitee(worker.makeSubstitutionGoal(*i)); if (waitees.empty()) /* to prevent hang (no wake-up event) */ diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index 4ac0afe84..093499936 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -1,6 +1,7 @@ #include "misc.hh" #include "store-api.hh" #include "local-store.hh" +#include "globals.hh" namespace nix { @@ -69,7 +70,8 @@ void queryMissing(StoreAPI & store, const PathSet & targets, bool mustBuild = false; foreach (DerivationOutputs::iterator, i, drv.outputs) - if (!store.isValidPath(i->second.path) && !store.hasSubstitutes(i->second.path)) + if (!store.isValidPath(i->second.path) && + !(queryBoolSetting("build-use-substitutes", true) && store.hasSubstitutes(i->second.path))) mustBuild = true; if (mustBuild) { diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 0b8fa36f6..0fd759b07 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -197,6 +197,9 @@ void RemoteStore::setOptions() } if (GET_PROTOCOL_MINOR(daemonVersion) >= 6) writeInt(buildCores, to); + if (GET_PROTOCOL_MINOR(daemonVersion) >= 10) + writeInt(queryBoolSetting("build-use-substitutes", true), to); + processStderr(); } diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index ef1e0993d..6e0aadad4 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/worker-protocol.hh @@ -8,7 +8,7 @@ namespace nix { #define WORKER_MAGIC_1 0x6e697863 #define WORKER_MAGIC_2 0x6478696f -#define PROTOCOL_VERSION 0x109 +#define PROTOCOL_VERSION 0x10a #define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00) #define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff) |