diversify "unable to spawn" failure messages

to help understand where a spurious failure is occurring
This commit is contained in:
Andrew Kelley 2024-11-26 13:56:12 -08:00
parent 68b3f50866
commit 11bf2d92de
6 changed files with 9 additions and 9 deletions

View file

@ -339,7 +339,7 @@ pub fn captureChildProcess(
.allocator = arena,
.argv = argv,
.progress_node = progress_node,
}) catch |err| return s.fail("unable to spawn {s}: {s}", .{ argv[0], @errorName(err) });
}) catch |err| return s.fail("failed to run {s}: {s}", .{ argv[0], @errorName(err) });
if (result.stderr.len > 0) {
try s.result_error_msgs.append(arena, result.stderr);
@ -423,7 +423,7 @@ pub fn evalZigProcess(
child.request_resource_usage_statistics = true;
child.progress_node = prog_node;
child.spawn() catch |err| return s.fail("unable to spawn {s}: {s}", .{
child.spawn() catch |err| return s.fail("failed to spawn zig compiler {s}: {s}", .{
argv[0], @errorName(err),
});

View file

@ -1137,7 +1137,7 @@ fn runCommand(
};
}
return step.fail("unable to spawn {s}: {s}", .{ argv[0], @errorName(err) });
return step.fail("failed to spawn and capture stdio from {s}: {s}", .{ argv[0], @errorName(err) });
};
step.result_duration_ns = result.elapsed_ns;

View file

@ -4772,7 +4772,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr
child.stderr_behavior = .Inherit;
const term = child.spawnAndWait() catch |err| {
return comp.failCObj(c_object, "unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
return comp.failCObj(c_object, "failed to spawn zig clang (passthrough mode) {s}: {s}", .{ argv.items[0], @errorName(err) });
};
switch (term) {
.Exited => |code| {
@ -4794,7 +4794,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: std.Pr
const stderr = try child.stderr.?.reader().readAllAlloc(arena, std.math.maxInt(usize));
const term = child.wait() catch |err| {
return comp.failCObj(c_object, "unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
return comp.failCObj(c_object, "failed to spawn zig clang {s}: {s}", .{ argv.items[0], @errorName(err) });
};
switch (term) {

View file

@ -1648,7 +1648,7 @@ pub fn spawnLld(
},
else => first_err,
};
log.err("unable to spawn {s}: {s}", .{ argv[0], @errorName(err) });
log.err("unable to spawn LLD {s}: {s}", .{ argv[0], @errorName(err) });
return error.UnableToSpawnSelf;
};

View file

@ -3722,7 +3722,7 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, tid: Zcu.PerThread.Id, prog_node:
child.stderr_behavior = .Inherit;
const term = child.spawnAndWait() catch |err| {
log.err("unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
log.err("failed to spawn (passthrough mode) LLD {s}: {s}", .{ argv.items[0], @errorName(err) });
return error.UnableToSpawnWasm;
};
switch (term) {
@ -3743,7 +3743,7 @@ fn linkWithLLD(wasm: *Wasm, arena: Allocator, tid: Zcu.PerThread.Id, prog_node:
const stderr = try child.stderr.?.reader().readAllAlloc(arena, std.math.maxInt(usize));
const term = child.wait() catch |err| {
log.err("unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
log.err("failed to spawn LLD {s}: {s}", .{ argv.items[0], @errorName(err) });
return error.UnableToSpawnWasm;
};

View file

@ -5244,7 +5244,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
std.debug.lockStdErr();
defer std.debug.unlockStdErr();
break :t child.spawnAndWait() catch |err| {
fatal("unable to spawn {s}: {s}", .{ child_argv.items[0], @errorName(err) });
fatal("failed to spawn build runner {s}: {s}", .{ child_argv.items[0], @errorName(err) });
};
};