From 6846ed8b442c20430b816a6b2ec926c841e38e0d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 12 Aug 2010 09:21:50 +0000 Subject: [PATCH] * Make --cores work when building through the Nix daemon. --- src/libstore/remote-store.cc | 3 +++ src/libstore/worker-protocol.hh | 2 +- src/nix-worker/nix-worker.cc | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 9db90c872..3d8b2a0c4 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -198,6 +198,9 @@ void RemoteStore::setOptions() writeInt(logType, to); writeInt(printBuildTrace, to); } + if (GET_PROTOCOL_MINOR(daemonVersion) >= 6) { + writeInt(buildCores, to); + } processStderr(); } diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index e44c1e36b..5504773b8 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/worker-protocol.hh @@ -8,7 +8,7 @@ namespace nix { #define WORKER_MAGIC_1 0x6e697863 #define WORKER_MAGIC_2 0x6478696f -#define PROTOCOL_VERSION 0x105 +#define PROTOCOL_VERSION 0x106 #define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00) #define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff) diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc index 0052fbb7d..13cecf654 100644 --- a/src/nix-worker/nix-worker.cc +++ b/src/nix-worker/nix-worker.cc @@ -500,6 +500,9 @@ static void performOp(unsigned int clientVersion, logType = (LogType) readInt(from); printBuildTrace = readInt(from) != 0; } + if (GET_PROTOCOL_MINOR(clientVersion) >= 6) { + buildCores = readInt(from); + } startWork(); stopWork(); break;