diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2022-02-20 16:02:44 +0100 |
---|---|---|
committer | Maximilian Bosch <maximilian@mbosch.me> | 2022-02-28 17:27:52 +0100 |
commit | 102cb390864f8a142ad6730d3456784e2778a493 (patch) | |
tree | f418b33d69d193a51e82fb656b58f1200f7efb02 | |
parent | 287642f132d8141269bd7c23b0bc7c1ee512b171 (diff) |
libstore/build: add a few explanatory comments; simplify
-rw-r--r-- | src/libstore/build/derivation-goal.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index c49be5e79..ae250ffaf 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -1177,6 +1177,7 @@ bool DerivationGoal::isReadDesc(int fd) void DerivationGoal::handleChildOutput(int fd, std::string_view data) { + // local & `ssh://`-builds are dealt with here. auto isWrittenToLog = isReadDesc(fd); if (isWrittenToLog) { @@ -1210,11 +1211,11 @@ void DerivationGoal::handleChildOutput(int fd, std::string_view data) auto json = parseJSONMessage(currentHookLine); if (json) { auto s = handleJSONLogMessage(*json, worker.act, hook->activities, true); - if (s && !isWrittenToLog && logSink) { - if ((*json)["type"] == resBuildLogLine) { - auto f = (*json)["fields"]; - (*logSink)((f.size() > 0 ? f.at(0).get<std::string>() : "") + "\n"); - } + // ensure that logs from a builder using `ssh-ng://` as protocol + // are also available to `nix log`. + if (s && !isWrittenToLog && logSink && (*json)["type"] == resBuildLogLine) { + auto f = (*json)["fields"]; + (*logSink)((f.size() > 0 ? f.at(0).get<std::string>() : "") + "\n"); } } currentHookLine.clear(); |