mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
aro: avoid asking for the time
this value should be calculated earlier and passed in
This commit is contained in:
parent
43c2ba375d
commit
97b9cc0adf
2 changed files with 4 additions and 4 deletions
2
lib/compiler/aro/aro/Compilation.zig
vendored
2
lib/compiler/aro/aro/Compilation.zig
vendored
|
|
@ -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) };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
6
lib/compiler/aro/aro/Driver.zig
vendored
6
lib/compiler/aro/aro/Driver.zig
vendored
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue