diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-12-02 18:43:51 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-12-02 19:37:59 +0200 |
commit | 708d9070006fd46ffe4c2c3cf64154ea4430202a (patch) | |
tree | e951682bb1d8b22dadd4971425d9da74a6ec05db /nix/libstore/remote-store.cc | |
parent | e134baae774eaa78e7ae8c3d87db50170f023536 (diff) | |
download | guix-708d9070006fd46ffe4c2c3cf64154ea4430202a.tar guix-708d9070006fd46ffe4c2c3cf64154ea4430202a.tar.gz |
daemon: Add 'buildMode' parameter to 'buildPaths' RPC.
* nix/libstore/worker-protocol.hh (PROTOCOL_VERSION): Bump to 0x10f.
* nix/libstore/remote-store.cc (RemoteStore::buildPaths): Send the
BUILDMODE when the daemon supports it. Reject invalid values of
BUILDMODE for old daemons.
* nix/nix-daemon/nix-daemon.cc (performOp) <wopBuildPaths>: Read the
build mode when the client supports it.
Diffstat (limited to 'nix/libstore/remote-store.cc')
-rw-r--r-- | nix/libstore/remote-store.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/nix/libstore/remote-store.cc b/nix/libstore/remote-store.cc index 0539bbe127..324ef5eb30 100644 --- a/nix/libstore/remote-store.cc +++ b/nix/libstore/remote-store.cc @@ -462,11 +462,18 @@ Paths RemoteStore::importPaths(bool requireSignature, Source & source) void RemoteStore::buildPaths(const PathSet & drvPaths, BuildMode buildMode) { - if (buildMode != bmNormal) throw Error("repairing or checking is not supported when building through the Nix daemon"); openConnection(); writeInt(wopBuildPaths, to); - if (GET_PROTOCOL_MINOR(daemonVersion) >= 13) + if (GET_PROTOCOL_MINOR(daemonVersion) >= 13) { writeStrings(drvPaths, to); + if (GET_PROTOCOL_MINOR(daemonVersion) >= 15) { + writeInt(buildMode, to); + } + /* Old daemons did not take a 'buildMode' parameter, so we need to + validate it here on the client side. */ + else if (buildMode != bmNormal) throw Error("repairing or checking \ +is not supported when building through the Nix daemon"); + } else { /* For backwards compatibility with old daemons, strip output identifiers. */ |