diff options
| author | kcbanner <kcbanner@gmail.com> | 2025-10-08 03:49:13 -0400 |
|---|---|---|
| committer | kcbanner <kcbanner@gmail.com> | 2025-10-09 01:06:09 -0400 |
| commit | 8b6cdc3d8224cf1e97a970f78281db2fcd14b7a2 (patch) | |
| tree | 2b7c53bbec33d5c1d9edde483a51fc196ed602e6 /lib/std/Build/Step.zig | |
| parent | 447280d0d98b540aed4df83db7cf95a417d81611 (diff) | |
| download | zig-8b6cdc3d8224cf1e97a970f78281db2fcd14b7a2.tar.gz zig-8b6cdc3d8224cf1e97a970f78281db2fcd14b7a2.zip | |
- Rework common translate-c and cImport logic into `Compilation.translateC`
- Add std.zig.Server.allocErrorBundle, replace duplicates
Diffstat (limited to 'lib/std/Build/Step.zig')
| -rw-r--r-- | lib/std/Build/Step.zig | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/std/Build/Step.zig b/lib/std/Build/Step.zig index 8e9e12248a..6e7e9c4702 100644 --- a/lib/std/Build/Step.zig +++ b/lib/std/Build/Step.zig @@ -524,22 +524,7 @@ fn zigProcessUpdate(s: *Step, zp: *ZigProcess, watch: bool, web_server: ?*Build. } }, .error_bundle => { - const EbHdr = std.zig.Server.Message.ErrorBundle; - const eb_hdr = @as(*align(1) const EbHdr, @ptrCast(body)); - const extra_bytes = - body[@sizeOf(EbHdr)..][0 .. @sizeOf(u32) * eb_hdr.extra_len]; - const string_bytes = - body[@sizeOf(EbHdr) + extra_bytes.len ..][0..eb_hdr.string_bytes_len]; - // TODO: use @ptrCast when the compiler supports it - const unaligned_extra = std.mem.bytesAsSlice(u32, extra_bytes); - { - s.result_error_bundle = .{ .string_bytes = &.{}, .extra = &.{} }; - errdefer s.result_error_bundle.deinit(gpa); - s.result_error_bundle.string_bytes = try gpa.dupe(u8, string_bytes); - const extra = try gpa.alloc(u32, unaligned_extra.len); - @memcpy(extra, unaligned_extra); - s.result_error_bundle.extra = extra; - } + s.result_error_bundle = try std.zig.Server.allocErrorBundle(gpa, body); // This message indicates the end of the update. if (watch) break :poll; }, |
