From b1eb25217217087cb70a730da5311bd0890cf6ad Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 17 Dec 2010 11:28:26 +0000 Subject: * Propagate the "100" exit status for failed builds through the Nix daemon. --- src/libstore/remote-store.cc | 7 +++++-- src/libstore/worker-protocol.hh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 26093a5d3abc..ae99846a3dfb 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -509,8 +509,11 @@ void RemoteStore::processStderr(Sink * sink, Source * source) writeToStderr((const unsigned char *) s.c_str(), s.size()); } } - if (msg == STDERR_ERROR) - throw Error(readString(from)); + if (msg == STDERR_ERROR) { + string error = readString(from); + unsigned int status = GET_PROTOCOL_MINOR(daemonVersion) >= 8 ? readInt(from) : 1; + throw Error(error, status); + } else if (msg != STDERR_LAST) throw Error("protocol error processing standard error"); } diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index d77049bc7188..acb8bc8b2948 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 0x107 +#define PROTOCOL_VERSION 0x108 #define GET_PROTOCOL_MAJOR(x) ((x) & 0xff00) #define GET_PROTOCOL_MINOR(x) ((x) & 0x00ff) -- cgit 1.4.1