From 97b9cc0adfee5b21079fccfde535b43391ac6233 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 18 Oct 2025 02:29:59 -0700 Subject: [PATCH] aro: avoid asking for the time this value should be calculated earlier and passed in --- lib/compiler/aro/aro/Compilation.zig | 2 +- lib/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 index e0b9a508cf..7d04589536 100644 --- 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 index 5d87268a5b..0b50321fe0 100644 --- 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",