libstore: flush log lines only from handleBuilderOutput

also change the tests to ensure that we handle all lines correctly.

Change-Id: I13de286bda8eee57acd53af1ab5c081d3048b500
This commit is contained in:
eldritch horrors
2025-10-13 11:26:49 +00:00
parent f29dfb3d3c
commit 1210a4e025
3 changed files with 10 additions and 7 deletions
+6 -5
View File
@@ -1250,6 +1250,11 @@ try {
lastChildActivity = AIO().provider.getTimer().now();
if (data.empty()) {
if (!currentLogLine.empty()) {
if (flushLine() == Logger::BufferState::NeedsFlush) {
TRY_AWAIT(act->getLogger().flush());
}
}
co_return std::nullopt;
}
@@ -1359,11 +1364,7 @@ try {
);
}
const auto r = TRY_AWAIT(handlers);
if (!currentLogLine.empty() && flushLine() == Logger::BufferState::NeedsFlush) {
TRY_AWAIT(act->getLogger().flush());
}
co_return r;
co_return TRY_AWAIT(handlers);
} catch (...) {
co_return result::current_exception();
}
+2 -1
View File
@@ -36,8 +36,9 @@ let
input3 = mkDerivation {
shell = busybox;
name = "build-remote-input-3";
# `echo -n` tests handling of logs without trailing newlines
buildCommand = ''
echo hi-input3
echo -n hi-input3
read x < ${input2}
echo $x BAZ > $out
'';
+2 -1
View File
@@ -39,8 +39,9 @@ let
input3 = mkDerivation {
shell = busybox;
name = "build-remote-input-3";
# `echo -n` tests handling of logs without trailing newlines
buildCommand = ''
echo hi-input3
echo -n hi-input3
read x < ${input2}
echo $x BAZ > $out
'';