diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-19T03·51+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-19T03·51+0100 |
commit | 9aa2ecd78cc865f69a9e978ae55ab0f3eda73c46 (patch) | |
tree | 68bfccf6a2ad88a3724a91431d7226ebc126c8d9 /third_party/nix/src/libstore/remote-store.cc | |
parent | c7be956f3f5e2b50e3af72a6170a455f20b1643b (diff) |
refactor(3p/nix/nix-daemon): Remove activities from protocol r/761
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.
Diffstat (limited to 'third_party/nix/src/libstore/remote-store.cc')
-rw-r--r-- | third_party/nix/src/libstore/remote-store.cc | 58 |
1 files changed, 1 insertions, 57 deletions
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<uint64_t>(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<uint64_t>(from); // used to be ActivityId - const auto verbosity = static_cast<compat::Verbosity>(readInt(from)); - readInt(from); // activity type - const auto msg = readString(from); - ignoreFields(from); - readNum<uint64_t>(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<uint64_t>(from); // used to be ActivityId - } - - else if (msg == STDERR_RESULT) { - readNum<uint64_t>(from); // ActivityId - readInt(from); // ResultType - ignoreFields(from); + LOG(INFO) << readString(from); } else if (msg == STDERR_LAST) { |