1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

daemon: Add 'buildMode' parameter to 'buildPaths' RPC

This commit is contained in:
Ludovic Courtès 2015-12-02 18:13:33 +01:00 committed by Eelco Dolstra
parent 8063fc497a
commit d1e3bf01bc
3 changed files with 20 additions and 5 deletions

View file

@ -319,8 +319,17 @@ static void performOp(bool trusted, unsigned int clientVersion,
case wopBuildPaths: {
PathSet drvs = readStorePaths<PathSet>(from);
BuildMode mode = bmNormal;
if (GET_PROTOCOL_MINOR(clientVersion) >= 15) {
mode = (BuildMode)readInt(from);
/* Repairing is not atomic, so disallowed for "untrusted"
clients. */
if (mode == bmRepair && !trusted)
throw Error("repairing is not supported when building through the Nix daemon");
}
startWork();
store->buildPaths(drvs);
store->buildPaths(drvs, mode);
stopWork();
to << 1;
break;