From 9aa2ecd78cc865f69a9e978ae55ab0f3eda73c46 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 May 2020 04:51:45 +0100 Subject: refactor(3p/nix/nix-daemon): Remove activities from protocol Removes the activity transfer that was previously nulled out from the daemon protocol completely. This might actually break Nix completely, I haven't tried yet, but that's fine because this will be replaced with gRPC. --- third_party/nix/src/libstore/remote-store.cc | 58 +--------------------------- 1 file changed, 1 insertion(+), 57 deletions(-) (limited to 'third_party/nix/src/libstore/remote-store.cc') diff --git a/third_party/nix/src/libstore/remote-store.cc b/third_party/nix/src/libstore/remote-store.cc index d041c452a860..ce2fc3888774 100644 --- a/third_party/nix/src/libstore/remote-store.cc +++ b/third_party/nix/src/libstore/remote-store.cc @@ -632,31 +632,6 @@ RemoteStore::Connection::~Connection() { } } -// TODO(tazjin): these logger fields used to be passed to the JSON -// logger but I don't care about them, whatever sends them should -// also be fixed. -static void ignoreFields(Source& from) { - size_t size = readInt(from); - - // This ignores the fields simply by reading the data into nowhere. - for (size_t n = 0; n < size; n++) { - auto type_tag = readInt(from); - - switch (type_tag) { - case 0: // previously: 0 ~ Logger::Field::tInt - readNum(from); - break; - - case 1: // previously: 1 ~ Logger::Field::tString - readString(from); - break; - - default: - throw Error("got unsupported field type %x from Nix daemon", type_tag); - } - } -} - std::exception_ptr RemoteStore::Connection::processStderr(Sink* sink, Source* source) { to.flush(); @@ -689,38 +664,7 @@ std::exception_ptr RemoteStore::Connection::processStderr(Sink* sink, } else if (msg == STDERR_START_ACTIVITY) { - // Various fields need to be ignored in this case, as the - // activity stuff is being removed. - readNum(from); // used to be ActivityId - const auto verbosity = static_cast(readInt(from)); - readInt(from); // activity type - const auto msg = readString(from); - ignoreFields(from); - readNum(from); // ActivityId of "parent" - - switch (verbosity) { - case compat::kError: - LOG(ERROR) << msg; - break; - case compat::kWarn: - LOG(WARNING) << msg; - break; - case compat::kInfo: - LOG(INFO) << msg; - break; - default: - DLOG(INFO) << msg; - } - } - - else if (msg == STDERR_STOP_ACTIVITY) { - readNum(from); // used to be ActivityId - } - - else if (msg == STDERR_RESULT) { - readNum(from); // ActivityId - readInt(from); // ResultType - ignoreFields(from); + LOG(INFO) << readString(from); } else if (msg == STDERR_LAST) { -- cgit 1.4.1