Skip to content

Commit 1fc5517

Browse files
committed
build runner: show stderr even on successful steps run
1 parent 6110c63 commit 1fc5517

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/build_runner.zig

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,21 @@ fn workerMakeOneStep(
428428
// For example, CompileStep does some sus things with modifying the saved
429429
// *Build object in install header steps that might be able to be removed
430430
// by passing the *Build object through the make() functions.
431-
s.make() catch |err| {
432-
s.result.err_code = err;
433-
@atomicStore(Step.State, &s.state, .failure, .SeqCst);
431+
const make_result = s.make();
434432

433+
// No matter the result, we want to display error/warning messages.
434+
if (s.result.error_msgs.items.len > 0) {
435435
sub_prog_node.context.lock_stderr();
436436
defer sub_prog_node.context.unlock_stderr();
437437

438438
for (s.result.error_msgs.items) |msg| {
439-
std.io.getStdErr().writeAll(msg) catch return;
439+
std.io.getStdErr().writeAll(msg) catch break;
440440
}
441+
}
442+
443+
make_result catch |err| {
444+
s.result.err_code = err;
445+
@atomicStore(Step.State, &s.state, .failure, .SeqCst);
441446
return;
442447
};
443448

0 commit comments

Comments
 (0)