From 37a7d2c78d27a327c70bb6865e1c6d114459a3af Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 14 Mar 2023 14:36:34 -0700 Subject: [PATCH] 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. --- lib/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 index b6bc0c43a4..d2fb20bdae 100644 --- 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)