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 {...@@ -114,7 +114,7 @@ pub const Environment = struct {
114 if (parsed > max_timestamp) return error.InvalidEpoch;114 if (parsed > max_timestamp) return error.InvalidEpoch;
115 return .{ .provided = parsed };115 return .{ .provided = parsed };
116 } else {116 } 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;
118 return .{ .system = std.math.clamp(timestamp, 0, max_timestamp) };118 return .{ .system = std.math.clamp(timestamp, 0, max_timestamp) };
119 }119 }
120 }120 }
lib/compiler/aro/aro/Driver.zig+3-3
...@@ -273,6 +273,7 @@ pub fn parseArgs(...@@ -273,6 +273,7 @@ pub fn parseArgs(
273 macro_buf: *std.ArrayList(u8),273 macro_buf: *std.ArrayList(u8),
274 args: []const []const u8,274 args: []const []const u8,
275) (Compilation.Error || std.Io.Writer.Error)!bool {275) (Compilation.Error || std.Io.Writer.Error)!bool {
276 const io = d.comp.io;
276 var i: usize = 1;277 var i: usize = 1;
277 var comment_arg: []const u8 = "";278 var comment_arg: []const u8 = "";
278 var hosted: ?bool = null;279 var hosted: ?bool = null;
...@@ -772,7 +773,7 @@ pub fn parseArgs(...@@ -772,7 +773,7 @@ pub fn parseArgs(
772 opts.arch_os_abi, @errorName(e),773 opts.arch_os_abi, @errorName(e),
773 }),774 }),
774 };775 };
775 d.comp.target = std.zig.system.resolveTargetQuery(query) catch |e| {776 d.comp.target = std.zig.system.resolveTargetQuery(io, query) catch |e| {
776 return d.fatal("unable to resolve target: {s}", .{errorDescription(e)});777 return d.fatal("unable to resolve target: {s}", .{errorDescription(e)});
777 };778 };
778 }779 }
...@@ -916,8 +917,7 @@ pub fn errorDescription(e: anyerror) []const u8 {...@@ -916,8 +917,7 @@ pub fn errorDescription(e: anyerror) []const u8 {
916 error.NotDir => "is not a directory",917 error.NotDir => "is not a directory",
917 error.NotOpenForReading => "file is not open for reading",918 error.NotOpenForReading => "file is not open for reading",
918 error.NotOpenForWriting => "file is not open for writing",919 error.NotOpenForWriting => "file is not open for writing",
919 error.InvalidUtf8 => "path is not valid UTF-8",920 error.BadPathName => "bad path name",
920 error.InvalidWtf8 => "path is not valid WTF-8",
921 error.FileBusy => "file is busy",921 error.FileBusy => "file is busy",
922 error.NameTooLong => "file name is too long",922 error.NameTooLong => "file name is too long",
923 error.AccessDenied => "access denied",923 error.AccessDenied => "access denied",