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:
parent
6e06a18d1b
commit
71a5161365
5 changed files with 34 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue