authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-22 22:30:02-08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-12-23 22:15:12-08:00
log7a09d579b55f942afe563b2c34b8d96c3e62c8c0
treebd5871934b810347a4506f190a2baa783e82a418
parent60e90adbcf0244190e959efde4d5b8670d456029

CLI: lock stderr while running jit cmd


1 files changed, 10 insertions(+), 6 deletions(-)

src/main.zig+10-6
...@@ -5687,14 +5687,18 @@ fn jitCmd(...@@ -5687,14 +5687,18 @@ fn jitCmd(
5687 child.stdout_behavior = if (options.capture == null) .Inherit else .Pipe;5687 child.stdout_behavior = if (options.capture == null) .Inherit else .Pipe;
5688 child.stderr_behavior = .Inherit;5688 child.stderr_behavior = .Inherit;
56895689
5690 try child.spawn(io);5690 const term = t: {
5691 _ = try io.lockStderr(&.{}, .no_color);
5692 defer io.unlockStderr();
5693 try child.spawn(io);
56915694
5692 if (options.capture) |ptr| {5695 if (options.capture) |ptr| {
5693 var stdout_reader = child.stdout.?.readerStreaming(io, &.{});5696 var stdout_reader = child.stdout.?.readerStreaming(io, &.{});
5694 ptr.* = try stdout_reader.interface.allocRemaining(arena, .limited(std.math.maxInt(u32)));5697 ptr.* = try stdout_reader.interface.allocRemaining(arena, .limited(std.math.maxInt(u32)));
5695 }5698 }
56965699
5697 const term = try child.wait(io);5700 break :t try child.wait(io);
5701 };
5698 switch (term) {5702 switch (term) {
5699 .Exited => |code| {5703 .Exited => |code| {
5700 if (code == 0) {5704 if (code == 0) {