aboutsummaryrefslogtreecommitdiff
path: root/lib/build_runner.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-02-16 15:08:37 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-03-15 10:48:12 -0700
commit26486c7f235596ffdcbfcd44283a787b049561b8 (patch)
treed2e2088967cd929cd32f5785fe2be3eb22ff0f56 /lib/build_runner.zig
parentc5edd8b7f87f8432bbf058b3456393793118906e (diff)
downloadzig-26486c7f235596ffdcbfcd44283a787b049561b8.tar.gz
zig-26486c7f235596ffdcbfcd44283a787b049561b8.zip
build runner: show stderr even on successful steps run
Diffstat (limited to 'lib/build_runner.zig')
-rw-r--r--lib/build_runner.zig13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/build_runner.zig b/lib/build_runner.zig
index c1af3798ff..b2d89ba79c 100644
--- a/lib/build_runner.zig
+++ b/lib/build_runner.zig
@@ -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;
};