daemon: Add 'buildMode' parameter to 'buildPaths' RPC
This commit is contained in:
parent
8063fc497a
commit
d1e3bf01bc
3 changed files with 20 additions and 5 deletions
|
@ -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;
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace nix {
|
|||
#define WORKER_MAGIC_1 0x6e697863
|
||||
#define WORKER_MAGIC_2 0x6478696f
|
||||
|
||||
#define PROTOCOL_VERSION 0x10e
|
||||
#define PROTOCOL_VERSION 0x10f
|
||||
#define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00)
|
||||
#define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue