Skip to content

Commit

Permalink
report stderr when build on save runner exits early
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Dec 5, 2024
1 parent 022603a commit 1ba0cb9
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/features/diagnostics.zig
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,15 @@ pub const BuildOnSave = struct {

while (true) {
const header = transport.receiveMessage(null) catch |err| switch (err) {
error.EndOfStream => return,
error.EndOfStream => {
const stderr = self.child_process.stderr.?.readToEndAlloc(self.allocator, 16 * 1024 * 1024) catch "";
defer self.allocator.free(stderr);

if (stderr.len != 0) {
log.err("zig build runner exited with stderr:\n{s}", .{stderr});
}
return;
},
else => {
log.err("failed to receive message from build runner: {}", .{err});
return;
Expand Down

0 comments on commit 1ba0cb9

Please sign in to comment.