aboutsummaryrefslogtreecommitdiff
path: root/nix/nix-daemon
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-11-13 22:59:54 +0100
committerLudovic Courtès <ludo@gnu.org>2016-11-16 18:19:54 +0100
commitf9aefa2d5fb3f6aad25a907939ee872c828b33d0 (patch)
tree51c87ff2ca17cb4aabf456446a14c43446956219 /nix/nix-daemon
parent94d92c7796a3dd50c27d532315f7d497ac99f08e (diff)
downloadguix-f9aefa2d5fb3f6aad25a907939ee872c828b33d0.tar
guix-f9aefa2d5fb3f6aad25a907939ee872c828b33d0.tar.gz
daemon: Add 'built-in-builders' RPC.
* nix/libstore/builtins.cc (builtinBuilderNames): New function. * nix/libstore/builtins.hh (builtinBuilderNames): New declaration. * nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x160. (WorkerOp)[wopBuiltinBuilders]: New value. * nix/nix-daemon/nix-daemon.cc (performOp): Handle it. * guix/store.scm (operation-id)[built-in-builders]: New value. * guix/store.scm (read-arg): Add 'string-list'. (built-in-builders): New procedure. * tests/derivations.scm ("built-in-builders"): New test.
Diffstat (limited to 'nix/nix-daemon')
-rw-r--r--nix/nix-daemon/nix-daemon.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/nix/nix-daemon/nix-daemon.cc b/nix/nix-daemon/nix-daemon.cc
index 35c284f7e1..9b29b3e91d 100644
--- a/nix/nix-daemon/nix-daemon.cc
+++ b/nix/nix-daemon/nix-daemon.cc
@@ -6,6 +6,7 @@
#include "archive.hh"
#include "affinity.hh"
#include "globals.hh"
+#include "builtins.hh"
#include <algorithm>
@@ -671,6 +672,14 @@ static void performOp(bool trusted, unsigned int clientVersion,
break;
}
+ case wopBuiltinBuilders: {
+ startWork();
+ auto names = builtinBuilderNames();
+ stopWork();
+ writeStrings(names, to);
+ break;
+ }
+
default:
throw Error(format("invalid operation %1%") % op);
}