diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-24T00·36+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-24T01·13+0100 |
commit | 06d7b4aebd9e4a1a87f77fe59a8c08392318be5d (patch) | |
tree | 264bfbef18b5b93596d6eb805fc9e5647ddadb4b /third_party/nix/src/build-remote/build-remote.cc | |
parent | 10481d25861f1c25b53cfbd8119199ef2e918f9f (diff) |
refactor(3p/nix/libutil): Replace chomp() with absl::strings r/835
Diffstat (limited to 'third_party/nix/src/build-remote/build-remote.cc')
-rw-r--r-- | third_party/nix/src/build-remote/build-remote.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/third_party/nix/src/build-remote/build-remote.cc b/third_party/nix/src/build-remote/build-remote.cc index 04fcf389705d..9403d3c35e99 100644 --- a/third_party/nix/src/build-remote/build-remote.cc +++ b/third_party/nix/src/build-remote/build-remote.cc @@ -6,6 +6,8 @@ #include <set> #include <tuple> +#include <absl/strings/ascii.h> +#include <absl/strings/str_cat.h> #include <glog/logging.h> #include "derivations.hh" @@ -199,9 +201,10 @@ static int _main(int argc, char* argv[]) { storeUri = bestMachine->storeUri; } catch (std::exception& e) { - auto msg = chomp(drainFD(5, false)); + auto msg = absl::StripTrailingAsciiWhitespace(drainFD(5, false)); LOG(ERROR) << "cannot build on '" << bestMachine->storeUri - << "': " << e.what() << (msg.empty() ? "" : ": " + msg); + << "': " << e.what() + << (msg.empty() ? "" : absl::StrCat(": ", msg)); bestMachine->enabled = false; continue; } |