From 262af89f81eda6ce26845563141481d447e04a06 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 21 Aug 2020 01:53:36 +0100 Subject: feat(tvix): Write build logs into the build log sink This *should* wire up the builder's logs all the way back through the gRPC client, where they are then conveniently discarded. Change-Id: I65f22526d0b5a8b8d90f28665bc1b4bc7f7c802a Reviewed-on: https://cl.tvl.fyi/c/depot/+/1825 Reviewed-by: glittershark Tested-by: BuildkiteCI --- third_party/nix/src/libstore/build.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'third_party/nix/src/libstore/build.cc') diff --git a/third_party/nix/src/libstore/build.cc b/third_party/nix/src/libstore/build.cc index bdcb7a69f4..60890732e9 100644 --- a/third_party/nix/src/libstore/build.cc +++ b/third_party/nix/src/libstore/build.cc @@ -1473,7 +1473,7 @@ void DerivationGoal::tryToBuild() { if (hook) { msg += fmt(" on '%s'", machineName); } - LOG(INFO) << msg << "[" << drvPath << "]"; + log_sink_ << msg << "[" << drvPath << "]"; mcRunningBuilds = std::make_unique>(worker.runningBuilds); }; @@ -3782,6 +3782,7 @@ void DerivationGoal::deleteTmpDir(bool force) { } } +// TODO(tazjin): What ... what does this function ... do? void DerivationGoal::handleChildOutput(int fd, const std::string& data) { if ((hook && fd == hook->builderOut.readSide.get()) || (!hook && fd == builderOut.readSide.get())) { @@ -3824,7 +3825,7 @@ void DerivationGoal::handleChildOutput(int fd, const std::string& data) { } } -void DerivationGoal::handleEOF(int fd) { +void DerivationGoal::handleEOF(int /* fd */) { if (!currentLogLine.empty()) { flushLine(); } @@ -3834,7 +3835,7 @@ void DerivationGoal::handleEOF(int fd) { void DerivationGoal::flushLine() { if (settings.verboseBuild && (settings.printRepeatedBuilds || curRound == 1)) { - LOG(INFO) << currentLogLine; + log_sink_ << currentLogLine; } else { logTail.push_back(currentLogLine); if (logTail.size() > settings.logLines) { -- cgit 1.4.1