authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-10 22:48:12-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-29 06:20:49-07:00
logd40803284e6395e7a4a065a73c9fb09d1c0ff7a8
tree785a2959cb9508b1a6491d606844a431e422ad60
parent3b346223681b40ce1271688cbe4d650a43b8e613

progress towards compiler building again


4 files changed, 41 insertions(+), 41 deletions(-)

lib/std/zig/ErrorBundle.zig+7-5
...@@ -6,12 +6,13 @@...@@ -6,12 +6,13 @@
6//! There is one special encoding for this data structure. If both arrays are6//! There is one special encoding for this data structure. If both arrays are
7//! empty, it means there are no errors. This special encoding exists so that7//! empty, it means there are no errors. This special encoding exists so that
8//! heap allocation is not needed in the common case of no errors.8//! heap allocation is not needed in the common case of no errors.
9const ErrorBundle = @This();
910
10const std = @import("std");11const std = @import("std");
11const ErrorBundle = @This();12const Io = std.Io;
13const Writer = std.Io.Writer;
12const Allocator = std.mem.Allocator;14const Allocator = std.mem.Allocator;
13const assert = std.debug.assert;15const assert = std.debug.assert;
14const Writer = std.Io.Writer;
1516
16string_bytes: []const u8,17string_bytes: []const u8,
17/// The first thing in this array is an `ErrorMessageList`.18/// The first thing in this array is an `ErrorMessageList`.
...@@ -156,7 +157,7 @@ pub fn nullTerminatedString(eb: ErrorBundle, index: String) [:0]const u8 {...@@ -156,7 +157,7 @@ pub fn nullTerminatedString(eb: ErrorBundle, index: String) [:0]const u8 {
156}157}
157158
158pub const RenderOptions = struct {159pub const RenderOptions = struct {
159 ttyconf: std.Io.tty.Config,160 ttyconf: Io.tty.Config,
160 include_reference_trace: bool = true,161 include_reference_trace: bool = true,
161 include_source_line: bool = true,162 include_source_line: bool = true,
162 include_log_text: bool = true,163 include_log_text: bool = true,
...@@ -190,7 +191,7 @@ fn renderErrorMessageToWriter(...@@ -190,7 +191,7 @@ fn renderErrorMessageToWriter(
190 err_msg_index: MessageIndex,191 err_msg_index: MessageIndex,
191 w: *Writer,192 w: *Writer,
192 kind: []const u8,193 kind: []const u8,
193 color: std.Io.tty.Color,194 color: Io.tty.Color,
194 indent: usize,195 indent: usize,
195) (Writer.Error || std.posix.UnexpectedError)!void {196) (Writer.Error || std.posix.UnexpectedError)!void {
196 const ttyconf = options.ttyconf;197 const ttyconf = options.ttyconf;
...@@ -320,6 +321,7 @@ fn writeMsg(eb: ErrorBundle, err_msg: ErrorMessage, w: *Writer, indent: usize) !...@@ -320,6 +321,7 @@ fn writeMsg(eb: ErrorBundle, err_msg: ErrorMessage, w: *Writer, indent: usize) !
320321
321pub const Wip = struct {322pub const Wip = struct {
322 gpa: Allocator,323 gpa: Allocator,
324 io: Io,
323 string_bytes: std.ArrayListUnmanaged(u8),325 string_bytes: std.ArrayListUnmanaged(u8),
324 /// The first thing in this array is a ErrorMessageList.326 /// The first thing in this array is a ErrorMessageList.
325 extra: std.ArrayListUnmanaged(u32),327 extra: std.ArrayListUnmanaged(u32),
...@@ -806,7 +808,7 @@ pub const Wip = struct {...@@ -806,7 +808,7 @@ pub const Wip = struct {
806 };808 };
807 defer bundle.deinit(std.testing.allocator);809 defer bundle.deinit(std.testing.allocator);
808810
809 const ttyconf: std.Io.tty.Config = .no_color;811 const ttyconf: Io.tty.Config = .no_color;
810812
811 var bundle_buf: Writer.Allocating = .init(std.testing.allocator);813 var bundle_buf: Writer.Allocating = .init(std.testing.allocator);
812 const bundle_bw = &bundle_buf.interface;814 const bundle_bw = &bundle_buf.interface;
src/Compilation.zig+7-5
...@@ -1,7 +1,9 @@...@@ -1,7 +1,9 @@
1const Compilation = @This();1const Compilation = @This();
2const builtin = @import("builtin");
23
3const std = @import("std");4const std = @import("std");
4const builtin = @import("builtin");5const Io = std.Io;
6const Writer = std.Io.Writer;
5const fs = std.fs;7const fs = std.fs;
6const mem = std.mem;8const mem = std.mem;
7const Allocator = std.mem.Allocator;9const Allocator = std.mem.Allocator;
...@@ -12,7 +14,6 @@ const ThreadPool = std.Thread.Pool;...@@ -12,7 +14,6 @@ const ThreadPool = std.Thread.Pool;
12const WaitGroup = std.Thread.WaitGroup;14const WaitGroup = std.Thread.WaitGroup;
13const ErrorBundle = std.zig.ErrorBundle;15const ErrorBundle = std.zig.ErrorBundle;
14const fatal = std.process.fatal;16const fatal = std.process.fatal;
15const Writer = std.Io.Writer;
1617
17const Value = @import("Value.zig");18const Value = @import("Value.zig");
18const Type = @import("Type.zig");19const Type = @import("Type.zig");
...@@ -1095,6 +1096,7 @@ pub const CObject = struct {...@@ -1095,6 +1096,7 @@ pub const CObject = struct {
1095 bundle: Bundle,1096 bundle: Bundle,
1096 notes_len: u32,1097 notes_len: u32,
1097 ) !ErrorBundle.ErrorMessage {1098 ) !ErrorBundle.ErrorMessage {
1099 const io = eb.io;
1098 var start = diag.src_loc.offset;1100 var start = diag.src_loc.offset;
1099 var end = diag.src_loc.offset;1101 var end = diag.src_loc.offset;
1100 for (diag.src_ranges) |src_range| {1102 for (diag.src_ranges) |src_range| {
...@@ -1117,7 +1119,7 @@ pub const CObject = struct {...@@ -1117,7 +1119,7 @@ pub const CObject = struct {
1117 const file = fs.cwd().openFile(file_name, .{}) catch break :source_line 0;1119 const file = fs.cwd().openFile(file_name, .{}) catch break :source_line 0;
1118 defer file.close();1120 defer file.close();
1119 var buffer: [1024]u8 = undefined;1121 var buffer: [1024]u8 = undefined;
1120 var file_reader = file.reader(&buffer);1122 var file_reader = file.reader(io, &buffer);
1121 file_reader.seekTo(diag.src_loc.offset + 1 - diag.src_loc.column) catch break :source_line 0;1123 file_reader.seekTo(diag.src_loc.offset + 1 - diag.src_loc.column) catch break :source_line 0;
1122 var aw: Writer.Allocating = .init(eb.gpa);1124 var aw: Writer.Allocating = .init(eb.gpa);
1123 defer aw.deinit();1125 defer aw.deinit();
...@@ -1155,7 +1157,7 @@ pub const CObject = struct {...@@ -1155,7 +1157,7 @@ pub const CObject = struct {
1155 gpa.destroy(bundle);1157 gpa.destroy(bundle);
1156 }1158 }
11571159
1158 pub fn parse(gpa: Allocator, path: []const u8) !*Bundle {1160 pub fn parse(gpa: Allocator, io: Io, path: []const u8) !*Bundle {
1159 const BlockId = enum(u32) {1161 const BlockId = enum(u32) {
1160 Meta = 8,1162 Meta = 8,
1161 Diag,1163 Diag,
...@@ -1191,7 +1193,7 @@ pub const CObject = struct {...@@ -1191,7 +1193,7 @@ pub const CObject = struct {
1191 var buffer: [1024]u8 = undefined;1193 var buffer: [1024]u8 = undefined;
1192 const file = try fs.cwd().openFile(path, .{});1194 const file = try fs.cwd().openFile(path, .{});
1193 defer file.close();1195 defer file.close();
1194 var file_reader = file.reader(&buffer);1196 var file_reader = file.reader(io, &buffer);
1195 var bc = std.zig.llvm.BitcodeReader.init(gpa, .{ .reader = &file_reader.interface });1197 var bc = std.zig.llvm.BitcodeReader.init(gpa, .{ .reader = &file_reader.interface });
1196 defer bc.deinit();1198 defer bc.deinit();
11971199
src/main.zig+26-29
...@@ -319,7 +319,7 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {...@@ -319,7 +319,7 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
319 .root_src_path = "objcopy.zig",319 .root_src_path = "objcopy.zig",
320 });320 });
321 } else if (mem.eql(u8, cmd, "fetch")) {321 } else if (mem.eql(u8, cmd, "fetch")) {
322 return cmdFetch(gpa, arena, cmd_args);322 return cmdFetch(gpa, arena, io, cmd_args);
323 } else if (mem.eql(u8, cmd, "libc")) {323 } else if (mem.eql(u8, cmd, "libc")) {
324 return jitCmd(gpa, arena, io, cmd_args, .{324 return jitCmd(gpa, arena, io, cmd_args, .{
325 .cmd_name = "libc",325 .cmd_name = "libc",
...@@ -348,12 +348,14 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {...@@ -348,12 +348,14 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
348 return;348 return;
349 } else if (mem.eql(u8, cmd, "env")) {349 } else if (mem.eql(u8, cmd, "env")) {
350 dev.check(.env_command);350 dev.check(.env_command);
351 const host = std.zig.resolveTargetQueryOrFatal(io, .{});
351 var stdout_writer = fs.File.stdout().writer(&stdout_buffer);352 var stdout_writer = fs.File.stdout().writer(&stdout_buffer);
352 try @import("print_env.zig").cmdEnv(353 try @import("print_env.zig").cmdEnv(
353 arena,354 arena,
354 &stdout_writer.interface,355 &stdout_writer.interface,
355 args,356 args,
356 if (native_os == .wasi) wasi_preopens,357 if (native_os == .wasi) wasi_preopens,
358 &host,
357 );359 );
358 return stdout_writer.interface.flush();360 return stdout_writer.interface.flush();
359 } else if (mem.eql(u8, cmd, "reduce")) {361 } else if (mem.eql(u8, cmd, "reduce")) {
...@@ -368,11 +370,11 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {...@@ -368,11 +370,11 @@ fn mainArgs(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
368 dev.check(.help_command);370 dev.check(.help_command);
369 return fs.File.stdout().writeAll(usage);371 return fs.File.stdout().writeAll(usage);
370 } else if (mem.eql(u8, cmd, "ast-check")) {372 } else if (mem.eql(u8, cmd, "ast-check")) {
371 return cmdAstCheck(arena, cmd_args);373 return cmdAstCheck(arena, io, cmd_args);
372 } else if (mem.eql(u8, cmd, "detect-cpu")) {374 } else if (mem.eql(u8, cmd, "detect-cpu")) {
373 return cmdDetectCpu(io, cmd_args);375 return cmdDetectCpu(io, cmd_args);
374 } else if (build_options.enable_debug_extensions and mem.eql(u8, cmd, "changelist")) {376 } else if (build_options.enable_debug_extensions and mem.eql(u8, cmd, "changelist")) {
375 return cmdChangelist(arena, cmd_args);377 return cmdChangelist(arena, io, cmd_args);
376 } else if (build_options.enable_debug_extensions and mem.eql(u8, cmd, "dump-zir")) {378 } else if (build_options.enable_debug_extensions and mem.eql(u8, cmd, "dump-zir")) {
377 return cmdDumpZir(arena, cmd_args);379 return cmdDumpZir(arena, cmd_args);
378 } else if (build_options.enable_debug_extensions and mem.eql(u8, cmd, "llvm-ints")) {380 } else if (build_options.enable_debug_extensions and mem.eql(u8, cmd, "llvm-ints")) {
...@@ -741,7 +743,7 @@ const ArgMode = union(enum) {...@@ -741,7 +743,7 @@ const ArgMode = union(enum) {
741const Listen = union(enum) {743const Listen = union(enum) {
742 none,744 none,
743 stdio: if (dev.env.supports(.stdio_listen)) void else noreturn,745 stdio: if (dev.env.supports(.stdio_listen)) void else noreturn,
744 ip4: if (dev.env.supports(.network_listen)) std.net.Ip4Address else noreturn,746 ip4: if (dev.env.supports(.network_listen)) Io.net.Ip4Address else noreturn,
745};747};
746748
747const ArgsIterator = struct {749const ArgsIterator = struct {
...@@ -1335,7 +1337,7 @@ fn buildOutputType(...@@ -1335,7 +1337,7 @@ fn buildOutputType(
1335 const host, const port_text = mem.cutScalar(u8, next_arg, ':') orelse .{ next_arg, "14735" };1337 const host, const port_text = mem.cutScalar(u8, next_arg, ':') orelse .{ next_arg, "14735" };
1336 const port = std.fmt.parseInt(u16, port_text, 10) catch |err|1338 const port = std.fmt.parseInt(u16, port_text, 10) catch |err|
1337 fatal("invalid port number: '{s}': {s}", .{ port_text, @errorName(err) });1339 fatal("invalid port number: '{s}': {s}", .{ port_text, @errorName(err) });
1338 listen = .{ .ip4 = std.net.Ip4Address.parse(host, port) catch |err|1340 listen = .{ .ip4 = Io.net.Ip4Address.parse(host, port) catch |err|
1339 fatal("invalid host: '{s}': {s}", .{ host, @errorName(err) }) };1341 fatal("invalid host: '{s}': {s}", .{ host, @errorName(err) }) };
1340 }1342 }
1341 } else if (mem.eql(u8, arg, "--listen=-")) {1343 } else if (mem.eql(u8, arg, "--listen=-")) {
...@@ -3318,7 +3320,7 @@ fn buildOutputType(...@@ -3318,7 +3320,7 @@ fn buildOutputType(
3318 var file_writer = f.writer(&.{});3320 var file_writer = f.writer(&.{});
3319 var buffer: [1000]u8 = undefined;3321 var buffer: [1000]u8 = undefined;
3320 var hasher = file_writer.interface.hashed(Cache.Hasher.init("0123456789abcdef"), &buffer);3322 var hasher = file_writer.interface.hashed(Cache.Hasher.init("0123456789abcdef"), &buffer);
3321 var stdin_reader = fs.File.stdin().readerStreaming(&.{});3323 var stdin_reader = fs.File.stdin().readerStreaming(io, &.{});
3322 _ = hasher.writer.sendFileAll(&stdin_reader, .unlimited) catch |err| switch (err) {3324 _ = hasher.writer.sendFileAll(&stdin_reader, .unlimited) catch |err| switch (err) {
3323 error.WriteFailed => fatal("failed to write {s}: {t}", .{ dump_path, file_writer.err.? }),3325 error.WriteFailed => fatal("failed to write {s}: {t}", .{ dump_path, file_writer.err.? }),
3324 else => fatal("failed to pipe stdin to {s}: {t}", .{ dump_path, err }),3326 else => fatal("failed to pipe stdin to {s}: {t}", .{ dump_path, err }),
...@@ -3549,7 +3551,7 @@ fn buildOutputType(...@@ -3549,7 +3551,7 @@ fn buildOutputType(
3549 switch (listen) {3551 switch (listen) {
3550 .none => {},3552 .none => {},
3551 .stdio => {3553 .stdio => {
3552 var stdin_reader = fs.File.stdin().reader(&stdin_buffer);3554 var stdin_reader = fs.File.stdin().reader(io, &stdin_buffer);
3553 var stdout_writer = fs.File.stdout().writer(&stdout_buffer);3555 var stdout_writer = fs.File.stdout().writer(&stdout_buffer);
3554 try serve(3556 try serve(
3555 io,3557 io,
...@@ -3565,23 +3567,23 @@ fn buildOutputType(...@@ -3565,23 +3567,23 @@ fn buildOutputType(
3565 return cleanExit();3567 return cleanExit();
3566 },3568 },
3567 .ip4 => |ip4_addr| {3569 .ip4 => |ip4_addr| {
3568 const addr: std.net.Address = .{ .in = ip4_addr };3570 const addr: Io.net.IpAddress = .{ .ip4 = ip4_addr };
35693571
3570 var server = try addr.listen(.{3572 var server = try addr.listen(io, .{
3571 .reuse_address = true,3573 .reuse_address = true,
3572 });3574 });
3573 defer server.deinit();3575 defer server.deinit(io);
35743576
3575 const conn = try server.accept();3577 var stream = try server.accept(io);
3576 defer conn.stream.close();3578 defer stream.close(io);
35773579
3578 var input = conn.stream.reader(&stdin_buffer);3580 var input = stream.reader(io, &stdin_buffer);
3579 var output = conn.stream.writer(&stdout_buffer);3581 var output = stream.writer(io, &stdout_buffer);
35803582
3581 try serve(3583 try serve(
3582 io,3584 io,
3583 comp,3585 comp,
3584 input.interface(),3586 &input.interface,
3585 &output.interface,3587 &output.interface,
3586 test_exec_args.items,3588 test_exec_args.items,
3587 self_exe_path,3589 self_exe_path,
...@@ -5062,7 +5064,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8)...@@ -5062,7 +5064,7 @@ fn cmdBuild(gpa: Allocator, arena: Allocator, io: Io, args: []const []const u8)
5062 var http_client: if (dev.env.supports(.fetch_command)) std.http.Client else struct {5064 var http_client: if (dev.env.supports(.fetch_command)) std.http.Client else struct {
5063 allocator: Allocator,5065 allocator: Allocator,
5064 fn deinit(_: @This()) void {}5066 fn deinit(_: @This()) void {}
5065 } = .{ .allocator = gpa };5067 } = .{ .allocator = gpa, .io = io };
5066 defer http_client.deinit();5068 defer http_client.deinit();
50675069
5068 var unlazy_set: Package.Fetch.JobQueue.UnlazySet = .{};5070 var unlazy_set: Package.Fetch.JobQueue.UnlazySet = .{};
...@@ -5600,7 +5602,7 @@ fn jitCmd(...@@ -5600,7 +5602,7 @@ fn jitCmd(
5600 try child.spawn();5602 try child.spawn();
56015603
5602 if (options.capture) |ptr| {5604 if (options.capture) |ptr| {
5603 var stdout_reader = child.stdout.?.readerStreaming(&.{});5605 var stdout_reader = child.stdout.?.readerStreaming(io, &.{});
5604 ptr.* = try stdout_reader.interface.allocRemaining(arena, .limited(std.math.maxInt(u32)));5606 ptr.* = try stdout_reader.interface.allocRemaining(arena, .limited(std.math.maxInt(u32)));
5605 }5607 }
56065608
...@@ -6055,10 +6057,7 @@ const usage_ast_check =...@@ -6055,10 +6057,7 @@ const usage_ast_check =
6055 \\6057 \\
6056;6058;
60576059
6058fn cmdAstCheck(6060fn cmdAstCheck(arena: Allocator, io: Io, args: []const []const u8) !void {
6059 arena: Allocator,
6060 args: []const []const u8,
6061) !void {
6062 dev.check(.ast_check_command);6061 dev.check(.ast_check_command);
60636062
6064 const Zir = std.zig.Zir;6063 const Zir = std.zig.Zir;
...@@ -6106,7 +6105,7 @@ fn cmdAstCheck(...@@ -6106,7 +6105,7 @@ fn cmdAstCheck(
6106 };6105 };
6107 } else fs.File.stdin();6106 } else fs.File.stdin();
6108 defer if (zig_source_path != null) f.close();6107 defer if (zig_source_path != null) f.close();
6109 var file_reader: fs.File.Reader = f.reader(&stdin_buffer);6108 var file_reader: fs.File.Reader = f.reader(io, &stdin_buffer);
6110 break :s std.zig.readSourceFileToEndAlloc(arena, &file_reader) catch |err| {6109 break :s std.zig.readSourceFileToEndAlloc(arena, &file_reader) catch |err| {
6111 fatal("unable to load file '{s}' for ast-check: {s}", .{ display_path, @errorName(err) });6110 fatal("unable to load file '{s}' for ast-check: {s}", .{ display_path, @errorName(err) });
6112 };6111 };
...@@ -6448,10 +6447,7 @@ fn cmdDumpZir(...@@ -6448,10 +6447,7 @@ fn cmdDumpZir(
6448}6447}
64496448
6450/// This is only enabled for debug builds.6449/// This is only enabled for debug builds.
6451fn cmdChangelist(6450fn cmdChangelist(arena: Allocator, io: Io, args: []const []const u8) !void {
6452 arena: Allocator,
6453 args: []const []const u8,
6454) !void {
6455 dev.check(.changelist_command);6451 dev.check(.changelist_command);
64566452
6457 const color: Color = .auto;6453 const color: Color = .auto;
...@@ -6464,7 +6460,7 @@ fn cmdChangelist(...@@ -6464,7 +6460,7 @@ fn cmdChangelist(
6464 var f = fs.cwd().openFile(old_source_path, .{}) catch |err|6460 var f = fs.cwd().openFile(old_source_path, .{}) catch |err|
6465 fatal("unable to open old source file '{s}': {s}", .{ old_source_path, @errorName(err) });6461 fatal("unable to open old source file '{s}': {s}", .{ old_source_path, @errorName(err) });
6466 defer f.close();6462 defer f.close();
6467 var file_reader: fs.File.Reader = f.reader(&stdin_buffer);6463 var file_reader: fs.File.Reader = f.reader(io, &stdin_buffer);
6468 break :source std.zig.readSourceFileToEndAlloc(arena, &file_reader) catch |err|6464 break :source std.zig.readSourceFileToEndAlloc(arena, &file_reader) catch |err|
6469 fatal("unable to read old source file '{s}': {s}", .{ old_source_path, @errorName(err) });6465 fatal("unable to read old source file '{s}': {s}", .{ old_source_path, @errorName(err) });
6470 };6466 };
...@@ -6472,7 +6468,7 @@ fn cmdChangelist(...@@ -6472,7 +6468,7 @@ fn cmdChangelist(
6472 var f = fs.cwd().openFile(new_source_path, .{}) catch |err|6468 var f = fs.cwd().openFile(new_source_path, .{}) catch |err|
6473 fatal("unable to open new source file '{s}': {s}", .{ new_source_path, @errorName(err) });6469 fatal("unable to open new source file '{s}': {s}", .{ new_source_path, @errorName(err) });
6474 defer f.close();6470 defer f.close();
6475 var file_reader: fs.File.Reader = f.reader(&stdin_buffer);6471 var file_reader: fs.File.Reader = f.reader(io, &stdin_buffer);
6476 break :source std.zig.readSourceFileToEndAlloc(arena, &file_reader) catch |err|6472 break :source std.zig.readSourceFileToEndAlloc(arena, &file_reader) catch |err|
6477 fatal("unable to read new source file '{s}': {s}", .{ new_source_path, @errorName(err) });6473 fatal("unable to read new source file '{s}': {s}", .{ new_source_path, @errorName(err) });
6478 };6474 };
...@@ -6829,6 +6825,7 @@ const usage_fetch =...@@ -6829,6 +6825,7 @@ const usage_fetch =
6829fn cmdFetch(6825fn cmdFetch(
6830 gpa: Allocator,6826 gpa: Allocator,
6831 arena: Allocator,6827 arena: Allocator,
6828 io: Io,
6832 args: []const []const u8,6829 args: []const []const u8,
6833) !void {6830) !void {
6834 dev.check(.fetch_command);6831 dev.check(.fetch_command);
...@@ -6884,7 +6881,7 @@ fn cmdFetch(...@@ -6884,7 +6881,7 @@ fn cmdFetch(
6884 try thread_pool.init(.{ .allocator = gpa });6881 try thread_pool.init(.{ .allocator = gpa });
6885 defer thread_pool.deinit();6882 defer thread_pool.deinit();
68866883
6887 var http_client: std.http.Client = .{ .allocator = gpa };6884 var http_client: std.http.Client = .{ .allocator = gpa, .io = io };
6888 defer http_client.deinit();6885 defer http_client.deinit();
68896886
6890 try http_client.initDefaultProxies(arena);6887 try http_client.initDefaultProxies(arena);
src/print_env.zig+1-2
...@@ -14,6 +14,7 @@ pub fn cmdEnv(...@@ -14,6 +14,7 @@ pub fn cmdEnv(
14 .wasi => std.fs.wasi.Preopens,14 .wasi => std.fs.wasi.Preopens,
15 else => void,15 else => void,
16 },16 },
17 host: *const std.Target,
17) !void {18) !void {
18 const override_lib_dir: ?[]const u8 = try EnvVar.ZIG_LIB_DIR.get(arena);19 const override_lib_dir: ?[]const u8 = try EnvVar.ZIG_LIB_DIR.get(arena);
19 const override_global_cache_dir: ?[]const u8 = try EnvVar.ZIG_GLOBAL_CACHE_DIR.get(arena);20 const override_global_cache_dir: ?[]const u8 = try EnvVar.ZIG_GLOBAL_CACHE_DIR.get(arena);
...@@ -38,8 +39,6 @@ pub fn cmdEnv(...@@ -38,8 +39,6 @@ pub fn cmdEnv(
38 const zig_lib_dir = dirs.zig_lib.path orelse "";39 const zig_lib_dir = dirs.zig_lib.path orelse "";
39 const zig_std_dir = try dirs.zig_lib.join(arena, &.{"std"});40 const zig_std_dir = try dirs.zig_lib.join(arena, &.{"std"});
40 const global_cache_dir = dirs.global_cache.path orelse "";41 const global_cache_dir = dirs.global_cache.path orelse "";
41
42 const host = try std.zig.system.resolveTargetQuery(.{});
43 const triple = try host.zigTriple(arena);42 const triple = try host.zigTriple(arena);
4443
45 var serializer: std.zon.Serializer = .{ .writer = out };44 var serializer: std.zon.Serializer = .{ .writer = out };