Skip to content

Commit

Permalink
build runner: show stderr even on successful steps run
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Feb 16, 2023
1 parent 6110c63 commit 1fc5517
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/build_runner.zig
Original file line number Diff line number Diff line change
Expand Up @@ -428,16 +428,21 @@ fn workerMakeOneStep(
// For example, CompileStep does some sus things with modifying the saved
// *Build object in install header steps that might be able to be removed
// by passing the *Build object through the make() functions.
s.make() catch |err| {
s.result.err_code = err;
@atomicStore(Step.State, &s.state, .failure, .SeqCst);
const make_result = s.make();

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

for (s.result.error_msgs.items) |msg| {
std.io.getStdErr().writeAll(msg) catch return;
std.io.getStdErr().writeAll(msg) catch break;
}
}

make_result catch |err| {
s.result.err_code = err;
@atomicStore(Step.State, &s.state, .failure, .SeqCst);
return;
};

Expand Down

0 comments on commit 1fc5517

Please sign in to comment.