authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-11-26 13:56:12-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-11-26 13:56:40-08:00
log11bf2d92de5f335d4e07358d99f26fae08493f12
treebf32c9bbacdaaa17eeba1112508737e34b00bc1e
parent68b3f5086609b8e904edcec9ef2201cb54bc7200

diversify "unable to spawn" failure messages

to help understand where a spurious failure is occurring

6 files changed, 9 insertions(+), 9 deletions(-)

lib/std/Build/Step.zig+2-2
......@@ -339,7 +339,7 @@ pub fn captureChildProcess(
339339 .allocator = arena,
340340 .argv = argv,
341341 .progress_node = progress_node,
342 }) catch |err| return s.fail("unable to spawn {s}: {s}", .{ argv[0], @errorName(err) });
342 }) catch |err| return s.fail("failed to run {s}: {s}", .{ argv[0], @errorName(err) });
343343
344344 if (result.stderr.len > 0) {
345345 try s.result_error_msgs.append(arena, result.stderr);
......@@ -423,7 +423,7 @@ pub fn evalZigProcess(
423423 child.request_resource_usage_statistics = true;
424424 child.progress_node = prog_node;
425425
426 child.spawn() catch |err| return s.fail("unable to spawn {s}: {s}", .{
426 child.spawn() catch |err| return s.fail("failed to spawn zig compiler {s}: {s}", .{
427427 argv[0], @errorName(err),
428428 });
429429
lib/std/Build/Step/Run.zig+1-1
......@@ -1137,7 +1137,7 @@ fn runCommand(
11371137 };
11381138 }
11391139
1140 return step.fail("unable to spawn {s}: {s}", .{ argv[0], @errorName(err) });
1140 return step.fail("failed to spawn and capture stdio from {s}: {s}", .{ argv[0], @errorName(err) });
11411141 };
11421142
11431143 step.result_duration_ns = result.elapsed_ns;
src/Compilation.zig+2-2
......@@ -4772,7 +4772,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr
47724772 child.stderr_behavior = .Inherit;
47734773
47744774 const term = child.spawnAndWait() catch |err| {
4775 return comp.failCObj(c_object, "unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
4775 return comp.failCObj(c_object, "failed to spawn zig clang (passthrough mode) {s}: {s}", .{ argv.items[0], @errorName(err) });
47764776 };
47774777 switch (term) {
47784778 .Exited => |code| {
......@@ -4794,7 +4794,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr
47944794 const stderr = try child.stderr.?.reader().readAllAlloc(arena, std.math.maxInt(usize));
47954795
47964796 const term = child.wait() catch |err| {
4797 return comp.failCObj(c_object, "unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
4797 return comp.failCObj(c_object, "failed to spawn zig clang {s}: {s}", .{ argv.items[0], @errorName(err) });
47984798 };
47994799
48004800 switch (term) {
src/link.zig+1-1
......@@ -1648,7 +1648,7 @@ pub fn spawnLld(
16481648 },
16491649 else => first_err,
16501650 };
1651 log.err("unable to spawn {s}: {s}", .{ argv[0], @errorName(err) });
1651 log.err("unable to spawn LLD {s}: {s}", .{ argv[0], @errorName(err) });
16521652 return error.UnableToSpawnSelf;
16531653 };
16541654
src/link/Wasm.zig+2-2
......@@ -3722,7 +3722,7 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, tid: Zcu.PerThread.Id, prog_node:
37223722 child.stderr_behavior = .Inherit;
37233723
37243724 const term = child.spawnAndWait() catch |err| {
3725 log.err("unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
3725 log.err("failed to spawn (passthrough mode) LLD {s}: {s}", .{ argv.items[0], @errorName(err) });
37263726 return error.UnableToSpawnWasm;
37273727 };
37283728 switch (term) {
......@@ -3743,7 +3743,7 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, tid: Zcu.PerThread.Id, prog_node:
37433743 const stderr = try child.stderr.?.reader().readAllAlloc(arena, std.math.maxInt(usize));
37443744
37453745 const term = child.wait() catch |err| {
3746 log.err("unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
3746 log.err("failed to spawn LLD {s}: {s}", .{ argv.items[0], @errorName(err) });
37473747 return error.UnableToSpawnWasm;
37483748 };
37493749
src/main.zig+1-1
......@@ -5244,7 +5244,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
52445244 std.debug.lockStdErr();
52455245 defer std.debug.unlockStdErr();
52465246 break :t child.spawnAndWait() catch |err| {
5247 fatal("unable to spawn {s}: {s}", .{ child_argv.items[0], @errorName(err) });
5247 fatal("failed to spawn build runner {s}: {s}", .{ child_argv.items[0], @errorName(err) });
52485248 };
52495249 };
52505250