about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-09-03T10·56+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-09-03T10·56+0200
commit71a5161365f40699092e491bbff88473237fc432 (patch)
tree02d1303475e895283707e5548d4d93385730d222 /src/libstore
parent6e06a18d1b45ab50f54f527570aeff40201090ff (diff)
Implement buildDerivation() via the daemon
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/remote-store.cc10
-rw-r--r--src/libstore/worker-protocol.hh3
2 files changed, 11 insertions, 2 deletions
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index fdb0975ac0fa..ed9895ac8133 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -5,6 +5,7 @@
 #include "archive.hh"
 #include "affinity.hh"
 #include "globals.hh"
+#include "derivations.hh"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -458,7 +459,14 @@ void RemoteStore::buildPaths(const PathSet & drvPaths, BuildMode buildMode)
 BuildResult RemoteStore::buildDerivation(const Path & drvPath, const BasicDerivation & drv,
     BuildMode buildMode)
 {
-    throw Error("not implemented");
+    openConnection();
+    to << wopBuildDerivation << drvPath << drv << buildMode;
+    processStderr();
+    BuildResult res;
+    unsigned int status;
+    from >> status >> res.errorMsg;
+    res.status = (BuildResult::Status) status;
+    return res;
 }
 
 
diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh
index d037d7402ede..5a0ef5117aa6 100644
--- a/src/libstore/worker-protocol.hh
+++ b/src/libstore/worker-protocol.hh
@@ -43,7 +43,8 @@ typedef enum {
     wopQuerySubstitutablePaths = 32,
     wopQueryValidDerivers = 33,
     wopOptimiseStore = 34,
-    wopVerifyStore = 35
+    wopVerifyStore = 35,
+    wopBuildDerivation = 36,
 } WorkerOp;