about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/build.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-24T00·36+0100
committerVincent Ambo <tazjin@google.com>2020-05-24T01·13+0100
commit06d7b4aebd9e4a1a87f77fe59a8c08392318be5d (patch)
tree264bfbef18b5b93596d6eb805fc9e5647ddadb4b /third_party/nix/src/libstore/build.cc
parent10481d25861f1c25b53cfbd8119199ef2e918f9f (diff)
refactor(3p/nix/libutil): Replace chomp() with absl::strings r/835
Diffstat (limited to 'third_party/nix/src/libstore/build.cc')
-rw-r--r--third_party/nix/src/libstore/build.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/third_party/nix/src/libstore/build.cc b/third_party/nix/src/libstore/build.cc
index feac6fcbfddc..266cedc096ad 100644
--- a/third_party/nix/src/libstore/build.cc
+++ b/third_party/nix/src/libstore/build.cc
@@ -12,6 +12,7 @@
 #include <sstream>
 #include <thread>
 
+#include <absl/strings/ascii.h>
 #include <fcntl.h>
 #include <grp.h>
 #include <netdb.h>
@@ -461,7 +462,7 @@ void handleDiffHook(uid_t uid, uid_t gid, Path tryA, Path tryB, Path drvPath,
       }
 
       if (!diffRes.second.empty()) {
-        LOG(ERROR) << chomp(diffRes.second);
+        LOG(ERROR) << absl::StripTrailingAsciiWhitespace(diffRes.second);
       }
     } catch (Error& error) {
       LOG(ERROR) << "diff hook execution failed: " << error.what();
@@ -1640,7 +1641,8 @@ MakeError(NotDeterministic, BuildError)
 
       hookEnvironment.emplace("DRV_PATH", drvPath);
       hookEnvironment.emplace("OUT_PATHS",
-                              chomp(concatStringsSep(" ", outputPaths)));
+                              absl::StripTrailingAsciiWhitespace(
+                                  concatStringsSep(" ", outputPaths)));
 
       RunOptions opts(settings.postBuildHook, {});
       opts.environment = hookEnvironment;
@@ -1788,7 +1790,8 @@ HookReply DerivationGoal::tryBuildHook() {
   } catch (SysError& e) {
     if (e.errNo == EPIPE) {
       LOG(ERROR) << "build hook died unexpectedly: "
-                 << chomp(drainFD(worker.hook->fromHook.readSide.get()));
+                 << absl::StripTrailingAsciiWhitespace(
+                        drainFD(worker.hook->fromHook.readSide.get()));
       worker.hook = nullptr;
       return rpDecline;
     }