Commit 0922990367

Matthew Lugg <mlugg@mlugg.co.uk>
2025-11-17 01:51:11
std.Build.Step: send messages to compiler as little-endian
Little-endian is what `std.zig.Server` expects, but the old logic just send the raw bytes of the struct, so sent in native endian (causing a crash on big-endian targets).
1 parent cd7d8df
Changed files (1)
lib
std
Build
lib/std/Build/Step.zig
@@ -680,7 +680,10 @@ fn sendMessage(file: std.fs.File, tag: std.zig.Client.Message.Tag) !void {
         .tag = tag,
         .bytes_len = 0,
     };
-    try file.writeAll(std.mem.asBytes(&header));
+    var w = file.writer(&.{});
+    w.interface.writeStruct(header, .little) catch |err| switch (err) {
+        error.WriteFailed => return w.err.?,
+    };
 }
 
 pub fn handleVerbose(