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

Implement buildDerivation() via the daemon

This commit is contained in:
Eelco Dolstra 2015-09-03 12:56:59 +02:00
parent 6e06a18d1b
commit 71a5161365
5 changed files with 34 additions and 2 deletions

View file

@ -7,6 +7,7 @@
#include "affinity.hh"
#include "globals.hh"
#include "monitor-fd.hh"
#include "derivations.hh"
#include <algorithm>
@ -325,6 +326,20 @@ static void performOp(bool trusted, unsigned int clientVersion,
break;
}
case wopBuildDerivation: {
Path drvPath = readStorePath(from);
BasicDerivation drv;
from >> drv;
BuildMode buildMode = (BuildMode) readInt(from);
startWork();
if (!trusted)
throw Error("you are not privileged to build derivations");
auto res = store->buildDerivation(drvPath, drv, buildMode);
stopWork();
to << res.status << res.errorMsg;
break;
}
case wopEnsurePath: {
Path path = readStorePath(from);
startWork();