diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-12-02T17·13+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-12-02T17·14+0100 |
commit | d1e3bf01bce7d8502610532077f6f55c3df4de2c (patch) | |
tree | be09364c3f1ec59db565c5eabe13b62661c6d3e0 /src/libstore/remote-store.cc | |
parent | 8063fc497ab78fa72962b93874fe25dcca2b55ed (diff) |
daemon: Add 'buildMode' parameter to 'buildPaths' RPC
Diffstat (limited to 'src/libstore/remote-store.cc')
-rw-r--r-- | src/libstore/remote-store.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index ed9895ac8133..262e4650bfb5 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -438,12 +438,18 @@ Paths RemoteStore::importPaths(bool requireSignature, Source & source) void RemoteStore::buildPaths(const PathSet & drvPaths, BuildMode buildMode) { - if (buildMode != bmNormal) throw Error("repairing or checking is not supported when building through the Nix daemon"); openConnection(); to << wopBuildPaths; - if (GET_PROTOCOL_MINOR(daemonVersion) >= 13) + if (GET_PROTOCOL_MINOR(daemonVersion) >= 13) { to << drvPaths; - else { + if (GET_PROTOCOL_MINOR(daemonVersion) >= 15) + to << buildMode; + else + /* Old daemons did not take a 'buildMode' parameter, so we + need to validate it here on the client side. */ + if (buildMode != bmNormal) + throw Error("repairing or checking is not supported when building through the Nix daemon"); + } else { /* For backwards compatibility with old daemons, strip output identifiers. */ PathSet drvPaths2; |