aboutsummaryrefslogtreecommitdiff
path: root/lib/build_runner.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-02-14 02:53:05 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-03-15 10:48:12 -0700
commit9580fbcf3596a39ba4c7d7af2f3a1df0e0abb746 (patch)
treecbec640f8c4cc29508b33b01b10cf85851233ba4 /lib/build_runner.zig
parent1fa1484288dc7431f73facb8c423b71670d6914e (diff)
downloadzig-9580fbcf3596a39ba4c7d7af2f3a1df0e0abb746.tar.gz
zig-9580fbcf3596a39ba4c7d7af2f3a1df0e0abb746.zip
build system: capture stderr and report it later
Instead of dumping directly to stderr. This prevents processes running simultaneously from racing their stderr against each other. For now it only reports at the end, but an improvement would be to report as soon as a failed step occurs.
Diffstat (limited to 'lib/build_runner.zig')
-rw-r--r--lib/build_runner.zig8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/build_runner.zig b/lib/build_runner.zig
index 87a9226bf1..6ba583c59d 100644
--- a/lib/build_runner.zig
+++ b/lib/build_runner.zig
@@ -318,8 +318,8 @@ fn runStepNames(b: *std.Build, step_names: []const []const u8) !void {
.success => continue,
.failure => {
any_failed = true;
- std.debug.print("{s}: {s}\n", .{
- s.name, @errorName(s.result.err_code),
+ std.debug.print("{s}: {s}\n{s}", .{
+ s.name, @errorName(s.result.err_code), s.result.stderr,
});
},
}
@@ -404,9 +404,7 @@ fn workerMakeOneStep(
// *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,
- };
+ s.result.err_code = err;
@atomicStore(Step.State, &s.state, .failure, .SeqCst);
return;
};