authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-18 02:29:59-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2025-10-29 06:20:50-07:00
log97b9cc0adfee5b21079fccfde535b43391ac6233
tree005e7bfb311c8dd73b971b5b77cf8f4f0ae5bff7
parent43c2ba375db502be3d6ba45cd5e949482e14bfae

aro: avoid asking for the time

this value should be calculated earlier and passed in

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

lib/compiler/aro/aro/Compilation.zig+1-1
......@@ -114,7 +114,7 @@ pub const Environment = struct {
114114 if (parsed > max_timestamp) return error.InvalidEpoch;
115115 return .{ .provided = parsed };
116116 } else {
117 const timestamp = std.math.cast(u64, std.time.timestamp()) orelse return error.InvalidEpoch;
117 const timestamp = std.math.cast(u64, 0) orelse return error.InvalidEpoch;
118118 return .{ .system = std.math.clamp(timestamp, 0, max_timestamp) };
119119 }
120120 }
lib/compiler/aro/aro/Driver.zig+3-3
......@@ -273,6 +273,7 @@ pub fn parseArgs(
273273 macro_buf: *std.ArrayList(u8),
274274 args: []const []const u8,
275275) (Compilation.Error || std.Io.Writer.Error)!bool {
276 const io = d.comp.io;
276277 var i: usize = 1;
277278 var comment_arg: []const u8 = "";
278279 var hosted: ?bool = null;
......@@ -772,7 +773,7 @@ pub fn parseArgs(
772773 opts.arch_os_abi, @errorName(e),
773774 }),
774775 };
775 d.comp.target = std.zig.system.resolveTargetQuery(query) catch |e| {
776 d.comp.target = std.zig.system.resolveTargetQuery(io, query) catch |e| {
776777 return d.fatal("unable to resolve target: {s}", .{errorDescription(e)});
777778 };
778779 }
......@@ -916,8 +917,7 @@ pub fn errorDescription(e: anyerror) []const u8 {
916917 error.NotDir => "is not a directory",
917918 error.NotOpenForReading => "file is not open for reading",
918919 error.NotOpenForWriting => "file is not open for writing",
919 error.InvalidUtf8 => "path is not valid UTF-8",
920 error.InvalidWtf8 => "path is not valid WTF-8",
920 error.BadPathName => "bad path name",
921921 error.FileBusy => "file is busy",
922922 error.NameTooLong => "file name is too long",
923923 error.AccessDenied => "access denied",