zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 97b9cc0adfee5b21079fccfde535b43391ac6233 (tree)
parent 43c2ba375db502be3d6ba45cd5e949482e14bfae
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Sat, 18 Oct 2025 02:29:59 -0700

aro: avoid asking for the time

this value should be calculated earlier and passed in

Diffstat:
Mlib/compiler/aro/aro/Compilation.zig | 2+-
Mlib/compiler/aro/aro/Driver.zig | 6+++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/compiler/aro/aro/Compilation.zig b/lib/compiler/aro/aro/Compilation.zig @@ -114,7 +114,7 @@ pub const Environment = struct { if (parsed > max_timestamp) return error.InvalidEpoch; return .{ .provided = parsed }; } else { - const timestamp = std.math.cast(u64, std.time.timestamp()) orelse return error.InvalidEpoch; + const timestamp = std.math.cast(u64, 0) orelse return error.InvalidEpoch; return .{ .system = std.math.clamp(timestamp, 0, max_timestamp) }; } } diff --git a/lib/compiler/aro/aro/Driver.zig b/lib/compiler/aro/aro/Driver.zig @@ -273,6 +273,7 @@ pub fn parseArgs( macro_buf: *std.ArrayList(u8), args: []const []const u8, ) (Compilation.Error || std.Io.Writer.Error)!bool { + const io = d.comp.io; var i: usize = 1; var comment_arg: []const u8 = ""; var hosted: ?bool = null; @@ -772,7 +773,7 @@ pub fn parseArgs( opts.arch_os_abi, @errorName(e), }), }; - d.comp.target = std.zig.system.resolveTargetQuery(query) catch |e| { + d.comp.target = std.zig.system.resolveTargetQuery(io, query) catch |e| { return d.fatal("unable to resolve target: {s}", .{errorDescription(e)}); }; } @@ -916,8 +917,7 @@ pub fn errorDescription(e: anyerror) []const u8 { error.NotDir => "is not a directory", error.NotOpenForReading => "file is not open for reading", error.NotOpenForWriting => "file is not open for writing", - error.InvalidUtf8 => "path is not valid UTF-8", - error.InvalidWtf8 => "path is not valid WTF-8", + error.BadPathName => "bad path name", error.FileBusy => "file is busy", error.NameTooLong => "file name is too long", error.AccessDenied => "access denied",