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).
This commit is contained in:
Matthew Lugg 2025-11-17 01:51:11 +01:00 committed by Alex Rønne Petersen
parent cd7d8dff26
commit 0922990367
No known key found for this signature in database

View file

@ -680,7 +680,10 @@ fn sendMessage(file: std.fs.File, tag: std.zig.Client.Message.Tag) !void {
.tag = tag, .tag = tag,
.bytes_len = 0, .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( pub fn handleVerbose(