authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-14 14:36:34-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-03-15 10:48:15-07:00
log37a7d2c78d27a327c70bb6865e1c6d114459a3af
tree7d4c4155269936dd5b59574543c42325fe3044a1
parent11de55d0ddd54afabb3e26a85adba0a1f0bbe35b

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.

1 files changed, 2 insertions(+), 4 deletions(-)

lib/std/Build/RunStep.zig+2-4
...@@ -676,7 +676,7 @@ fn runCommand(...@@ -676,7 +676,7 @@ fn runCommand(
676 try Step.handleVerbose2(step.owner, self.cwd, self.env_map, interp_argv.items);676 try Step.handleVerbose2(step.owner, self.cwd, self.env_map, interp_argv.items);
677677
678 break :term spawnChildAndCollect(self, interp_argv.items, has_side_effects, prog_node) catch |e| {678 break :term spawnChildAndCollect(self, interp_argv.items, has_side_effects, prog_node) catch |e| {
679 return step.fail("unable to spawn {s}: {s}", .{679 return step.fail("unable to spawn interpreter {s}: {s}", .{
680 interp_argv.items[0], @errorName(e),680 interp_argv.items[0], @errorName(e),
681 });681 });
682 };682 };
...@@ -889,9 +889,7 @@ fn spawnChildAndCollect(...@@ -889,9 +889,7 @@ fn spawnChildAndCollect(
889 child.stdin_behavior = .Pipe;889 child.stdin_behavior = .Pipe;
890 }890 }
891891
892 child.spawn() catch |err| return self.step.fail("unable to spawn {s}: {s}", .{892 try child.spawn();
893 argv[0], @errorName(err),
894 });
895 var timer = try std.time.Timer.start();893 var timer = try std.time.Timer.start();
896894
897 const result = if (self.stdio == .zig_test)895 const result = if (self.stdio == .zig_test)