aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-08-11 21:53:29 +0200
committereldritch horrors <pennae@lix.systems>2024-08-18 22:44:11 +0000
commit5cbca8553581a358f9b5067bc8def24b1c7b37cc (patch)
tree5561d68e3b8c98e9a8435df9c4ec66655c4579a2 /src/libstore/build
parente2d330aeed19a1bfed56ea55277ac9400fbc7fed (diff)
libstore: clarify that build log fd and hook log fd are different
only DerivationGoal can set the hook to anything at all. it always sets buildOutFD to something that is not related to fromHook in any way, and mixing the two would have rather dire consequences for log consistency. Change-Id: Ida86727fd1cd5e1ecd78f07f3bde330a346658a8
Diffstat (limited to 'src/libstore/build')
-rw-r--r--src/libstore/build/derivation-goal.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index f43a2a5b6..cc445a0a4 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -1288,9 +1288,7 @@ Goal::WorkResult DerivationGoal::handleChildOutput(int fd, std::string_view data
};
// local & `ssh://`-builds are dealt with here.
- auto isWrittenToLog = fd == builderOutFD->get();
- if (isWrittenToLog)
- {
+ if (fd == builderOutFD->get()) {
logSize += data.size();
if (settings.maxLogSize && logSize > settings.maxLogSize) {
return tooMuchLogs();
@@ -1308,6 +1306,7 @@ Goal::WorkResult DerivationGoal::handleChildOutput(int fd, std::string_view data
}
if (logSink) (*logSink)(data);
+ return StillAlive{};
}
if (hook && fd == hook->fromHook.readSide.get()) {
@@ -1318,7 +1317,7 @@ Goal::WorkResult DerivationGoal::handleChildOutput(int fd, std::string_view data
auto s = handleJSONLogMessage(*json, worker.act, hook->activities, true);
// ensure that logs from a builder using `ssh-ng://` as protocol
// are also available to `nix log`.
- if (s && !isWrittenToLog && logSink) {
+ if (s && logSink) {
const auto type = (*json)["type"];
const auto fields = (*json)["fields"];
if (type == resBuildLogLine) {