authorgravatar for xavierb@gmail.comXavier Bouchoux <xavierb@gmail.com> 2023-07-10 19:04:10+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-11 00:17:08-07:00
log7a8002a5cf8e6607c1a2bfbd12fec3e60390fc71
tree6a05097ab20158a0f52afbfa85f9283fe3c6daaf
parentdbc560904aa5570648709cb392204f25884dddd8

remove arbitrary stderr size limit when spawning a child process tool


5 files changed, 5 insertions(+), 10 deletions(-)

src/Compilation.zig+1-3
......@@ -4067,9 +4067,7 @@ fn updateCObject(comp: *Compilation, c_object: *CObject, c_obj_prog_node: *std.P
40674067
40684068 try child.spawn();
40694069
4070 const stderr_reader = child.stderr.?.reader();
4071
4072 const stderr = try stderr_reader.readAllAlloc(arena, 10 * 1024 * 1024);
4070 const stderr = try child.stderr.?.reader().readAllAlloc(arena, std.math.maxInt(usize));
40734071
40744072 const term = child.wait() catch |err| {
40754073 return comp.failCObj(c_object, "unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
src/link/Coff/lld.zig+1-1
......@@ -545,7 +545,7 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod
545545
546546 try child.spawn();
547547
548 const stderr = try child.stderr.?.reader().readAllAlloc(arena, 10 * 1024 * 1024);
548 const stderr = try child.stderr.?.reader().readAllAlloc(arena, std.math.maxInt(usize));
549549
550550 const term = child.wait() catch |err| {
551551 log.err("unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
src/link/Elf.zig+1-1
......@@ -1949,7 +1949,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v
19491949
19501950 try child.spawn();
19511951
1952 const stderr = try child.stderr.?.reader().readAllAlloc(arena, 10 * 1024 * 1024);
1952 const stderr = try child.stderr.?.reader().readAllAlloc(arena, std.math.maxInt(usize));
19531953
19541954 const term = child.wait() catch |err| {
19551955 log.err("unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
src/link/Wasm.zig+1-1
......@@ -4529,7 +4529,7 @@ fn linkWithLLD(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) !
45294529
45304530 try child.spawn();
45314531
4532 const stderr = try child.stderr.?.reader().readAllAlloc(arena, 10 * 1024 * 1024);
4532 const stderr = try child.stderr.?.reader().readAllAlloc(arena, std.math.maxInt(usize));
45334533
45344534 const term = child.wait() catch |err| {
45354535 log.err("unable to spawn {s}: {s}", .{ argv.items[0], @errorName(err) });
src/mingw.zig+1-4
......@@ -379,10 +379,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
379379
380380 try child.spawn();
381381
382 const stderr_reader = child.stderr.?.reader();
383
384 // TODO https://github.com/ziglang/zig/issues/6343
385 const stderr = try stderr_reader.readAllAlloc(arena, 10 * 1024 * 1024);
382 const stderr = try child.stderr.?.reader().readAllAlloc(arena, std.math.maxInt(usize));
386383
387384 const term = child.wait() catch |err| {
388385 // TODO surface a proper error here