From 4ea669562e4104b6991bd5a0c190a098c27a0660 Mon Sep 17 00:00:00 2001 From: "Tommy D. Rossi" Date: Sat, 3 Jan 2026 03:57:44 +0100 Subject: [PATCH 1/2] fix: use flush instead of end on stdout in code generators for Windows compatibility --- src/unicode/props_uucode.zig | 4 +++- src/unicode/symbols_uucode.zig | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/unicode/props_uucode.zig b/src/unicode/props_uucode.zig index 2440d437c..9813ecf43 100644 --- a/src/unicode/props_uucode.zig +++ b/src/unicode/props_uucode.zig @@ -87,7 +87,9 @@ pub fn main() !void { var buf: [4096]u8 = undefined; var stdout = std.fs.File.stdout().writer(&buf); try t.writeZig(&stdout.interface); - try stdout.end(); + // Use flush instead of end because stdout is a pipe when captured by + // the build system, and pipes cannot be truncated (especially on Windows). + try stdout.interface.flush(); // Uncomment when manually debugging to see our table sizes. // std.log.warn("stage1={} stage2={} stage3={}", .{ diff --git a/src/unicode/symbols_uucode.zig b/src/unicode/symbols_uucode.zig index 8cbd59211..1a7e20252 100644 --- a/src/unicode/symbols_uucode.zig +++ b/src/unicode/symbols_uucode.zig @@ -34,7 +34,9 @@ pub fn main() !void { var buf: [4096]u8 = undefined; var stdout = std.fs.File.stdout().writer(&buf); try t.writeZig(&stdout.interface); - try stdout.end(); + // Use flush instead of end because stdout is a pipe when captured by + // the build system, and pipes cannot be truncated (especially on Windows). + try stdout.interface.flush(); // Uncomment when manually debugging to see our table sizes. // std.log.warn("stage1={} stage2={} stage3={}", .{ From e2de0bfd9338321e59c0e157bab0696f4ce8a9a8 Mon Sep 17 00:00:00 2001 From: "Tommy D. Rossi" Date: Sat, 3 Jan 2026 13:44:29 +0100 Subject: [PATCH 2/2] fix: clarify error codes in comment --- src/unicode/props_uucode.zig | 3 ++- src/unicode/symbols_uucode.zig | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/unicode/props_uucode.zig b/src/unicode/props_uucode.zig index 9813ecf43..bee942422 100644 --- a/src/unicode/props_uucode.zig +++ b/src/unicode/props_uucode.zig @@ -88,7 +88,8 @@ pub fn main() !void { var stdout = std.fs.File.stdout().writer(&buf); try t.writeZig(&stdout.interface); // Use flush instead of end because stdout is a pipe when captured by - // the build system, and pipes cannot be truncated (especially on Windows). + // the build system, and pipes cannot be truncated (Windows returns + // INVALID_PARAMETER, Linux returns EINVAL). try stdout.interface.flush(); // Uncomment when manually debugging to see our table sizes. diff --git a/src/unicode/symbols_uucode.zig b/src/unicode/symbols_uucode.zig index 1a7e20252..794ca5bab 100644 --- a/src/unicode/symbols_uucode.zig +++ b/src/unicode/symbols_uucode.zig @@ -35,7 +35,8 @@ pub fn main() !void { var stdout = std.fs.File.stdout().writer(&buf); try t.writeZig(&stdout.interface); // Use flush instead of end because stdout is a pipe when captured by - // the build system, and pipes cannot be truncated (especially on Windows). + // the build system, and pipes cannot be truncated (Windows returns + // INVALID_PARAMETER, Linux returns EINVAL). try stdout.interface.flush(); // Uncomment when manually debugging to see our table sizes.