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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
'';
|
||||
|
||||
@@ -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
|
||||
'';
|
||||
|
||||
Reference in New Issue
Block a user