zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 37a7d2c78d27a327c70bb6865e1c6d114459a3af (tree)
parent 11de55d0ddd54afabb3e26a85adba0a1f0bbe35b
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Tue, 14 Mar 2023 14:36:34 -0700

std.Build.RunStep: fix handling spawn failure

The error was caught and created a Step failure rather than bubbling up
so that the interpreter logic could handle it. Fixes hundreds of test
failures on Windows.

Diffstat:
Mlib/std/Build/RunStep.zig | 6++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/std/Build/RunStep.zig b/lib/std/Build/RunStep.zig @@ -676,7 +676,7 @@ fn runCommand( try Step.handleVerbose2(step.owner, self.cwd, self.env_map, interp_argv.items); break :term spawnChildAndCollect(self, interp_argv.items, has_side_effects, prog_node) catch |e| { - return step.fail("unable to spawn {s}: {s}", .{ + return step.fail("unable to spawn interpreter {s}: {s}", .{ interp_argv.items[0], @errorName(e), }); }; @@ -889,9 +889,7 @@ fn spawnChildAndCollect( child.stdin_behavior = .Pipe; } - child.spawn() catch |err| return self.step.fail("unable to spawn {s}: {s}", .{ - argv[0], @errorName(err), - }); + try child.spawn(); var timer = try std.time.Timer.start(); const result = if (self.stdio == .zig_test)