all: update to latest Zig APIs

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2023-06-25 00:18:03 -07:00
parent 29964c99bb
commit c62bae6edc
2 changed files with 16 additions and 18 deletions

View file

@ -52,8 +52,8 @@ pub const Options = struct {
.os_tag = .macos, .os_tag = .macos,
.os_version = .{ .os_version = .{
.semver = .{ .semver = .{
.min = .{ .major = 13, .minor = 0 }, .min = .{ .major = 13, .minor = 0, .patch = std.math.maxInt(u32) },
.max = .{ .major = 14, .minor = std.math.maxInt(u32) }, .max = .{ .major = 14, .minor = std.math.maxInt(u32), .patch = std.math.maxInt(u32) },
}, },
}, },
}, },
@ -65,8 +65,8 @@ pub const Options = struct {
.os_tag = .macos, .os_tag = .macos,
.os_version = .{ .os_version = .{
.semver = .{ .semver = .{
.min = .{ .major = 12, .minor = 0 }, .min = .{ .major = 12, .minor = 0, .patch = std.math.maxInt(u32) },
.max = .{ .major = 12, .minor = std.math.maxInt(u32) }, .max = .{ .major = 12, .minor = std.math.maxInt(u32), .patch = std.math.maxInt(u32) },
}, },
}, },
}, },
@ -78,24 +78,24 @@ pub const Options = struct {
.os_tag = .macos, .os_tag = .macos,
.os_version = .{ .os_version = .{
.semver = .{ .semver = .{
.min = .{ .major = 11, .minor = 3 }, .min = .{ .major = 11, .minor = 3, .patch = std.math.maxInt(u32) },
.max = .{ .major = 11, .minor = std.math.maxInt(u32) }, .max = .{ .major = 11, .minor = std.math.maxInt(u32), .patch = std.math.maxInt(u32) },
}, },
}, },
}, },
.{ .{
.name = "sdk-linux-x86_64", .name = "sdk-linux-x86_64",
.git_addr = "https://github.com/hexops/sdk-linux-x86_64", .git_addr = "https://github.com/hexops/sdk-linux-x86_64",
.git_revision = "311a0f18a2350c032a40b5917ae25c05cf500683", .git_revision = "311a0f18a2350c032a40b5917ae25c05cf500683s",
.cpu_arch = &.{.x86_64}, .cpu_arch = &.{.x86_64},
.os_tag = .linux, .os_tag = .linux,
.os_version = .{ .os_version = .{
.linux = .{ .linux = .{
.range = .{ .range = .{
.min = .{ .major = 3, .minor = 16 }, .min = .{ .major = 3, .minor = 16, .patch = std.math.maxInt(u32) },
.max = .{ .major = 6, .minor = std.math.maxInt(u32) }, .max = .{ .major = 6, .minor = std.math.maxInt(u32), .patch = std.math.maxInt(u32) },
}, },
.glibc = .{ .major = 0, .minor = 0 }, .glibc = .{ .major = 0, .minor = 0, .patch = std.math.maxInt(u32) },
}, },
}, },
}, },
@ -108,10 +108,10 @@ pub const Options = struct {
.os_version = .{ .os_version = .{
.linux = .{ .linux = .{
.range = .{ .range = .{
.min = .{ .major = 3, .minor = 16 }, .min = .{ .major = 3, .minor = 16, .patch = std.math.maxInt(u32) },
.max = .{ .major = 6, .minor = std.math.maxInt(u32) }, .max = .{ .major = 6, .minor = std.math.maxInt(u32), .patch = std.math.maxInt(u32) },
}, },
.glibc = .{ .major = 0, .minor = 0 }, .glibc = .{ .major = 0, .minor = 0, .patch = std.math.maxInt(u32) },
}, },
}, },
}, },

View file

@ -222,7 +222,7 @@ pub fn Sdk(comptime deps: anytype) type {
// If min. target macOS version is lesser than the min version we have available, then // If min. target macOS version is lesser than the min version we have available, then
// our binary is incompatible with the target. // our binary is incompatible with the target.
const min_available = std.builtin.Version{ .major = 12, .minor = 0 }; const min_available = std.SemanticVersion{ .major = 12, .minor = 0, .patch = std.math.maxInt(u32) };
if (target.os.version_range.semver.min.order(min_available) == .lt) break :blk false; if (target.os.version_range.semver.min.order(min_available) == .lt) break :blk false;
break :blk true; break :blk true;
}, },
@ -427,12 +427,10 @@ pub fn Sdk(comptime deps: anytype) type {
const contents = try std.fs.cwd().readFileAlloc(allocator, json_file, std.math.maxInt(usize)); const contents = try std.fs.cwd().readFileAlloc(allocator, json_file, std.math.maxInt(usize));
defer allocator.free(contents); defer allocator.free(contents);
var parser = std.json.Parser.init(allocator, .alloc_if_needed); var tree = try std.json.parseFromSlice(std.json.Value, allocator, contents, .{});
defer parser.deinit();
var tree = try parser.parse(contents);
defer tree.deinit(); defer tree.deinit();
var iter = tree.root.object.iterator(); var iter = tree.value.object.iterator();
while (iter.next()) |f| { while (iter.next()) |f| {
const out_path = try std.fs.path.join(allocator, &.{ out_dir, f.key_ptr.* }); const out_path = try std.fs.path.join(allocator, &.{ out_dir, f.key_ptr.* });
defer allocator.free(out_path); defer allocator.free(out_path);