update zig version

This commit is contained in:
Mitchell Hashimoto
2023-05-29 08:24:12 -07:00
parent 5acf7eb8fd
commit 7116ce0806
4 changed files with 8 additions and 7 deletions

View File

@ -33,7 +33,7 @@ const Version = @import("src/build/Version.zig");
// but we liberally update it. In the future, we'll be more careful about // but we liberally update it. In the future, we'll be more careful about
// using released versions so that package managers can integrate better. // using released versions so that package managers can integrate better.
comptime { comptime {
const required_zig = "0.11.0-dev.3299+34865d693"; const required_zig = "0.11.0-dev.3312+ab37ab33c";
const current_zig = builtin.zig_version; const current_zig = builtin.zig_version;
const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable; const min_zig = std.SemanticVersion.parse(required_zig) catch unreachable;
if (current_zig.order(min_zig) == .lt) { if (current_zig.order(min_zig) == .lt) {

6
flake.lock generated
View File

@ -126,11 +126,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1685060590, "lastModified": 1685233488,
"narHash": "sha256-tlV0ZvAAoPqoXmOcOUHKpclIwVTOeyg55E99pzlovl4=", "narHash": "sha256-jZSAYhEogHMu6ITf+9aXaNhM4EGPYP+cnF7OOXUB1os=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "83b52af901b570e7fa3ebe042a78999b581cbfbc", "rev": "b12da37e8f786a0bd65a0551b2e5b7e96ed997e2",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -1,5 +1,6 @@
const std = @import("std"); const std = @import("std");
const builtin = @import("builtin"); const builtin = @import("builtin");
const NativeTargetInfo = std.zig.system.NativeTargetInfo;
/// Directories with our includes. /// Directories with our includes.
const root = thisDir() ++ "../../../vendor/fontconfig-2.14.0/"; const root = thisDir() ++ "../../../vendor/fontconfig-2.14.0/";
@ -153,8 +154,8 @@ pub fn buildFontconfig(
"-fno-sanitize=undefined", "-fno-sanitize=undefined",
"-fno-sanitize-trap=undefined", "-fno-sanitize-trap=undefined",
}); });
const arch = target.cpu_arch orelse builtin.cpu.arch; const target_info = try NativeTargetInfo.detect(target);
switch (arch.ptrBitWidth()) { switch (target_info.target.ptrBitWidth()) {
32 => try flags.appendSlice(&.{ 32 => try flags.appendSlice(&.{
"-DSIZEOF_VOID_P=4", "-DSIZEOF_VOID_P=4",
"-DALIGNOF_VOID_P=4", "-DALIGNOF_VOID_P=4",

View File

@ -248,7 +248,7 @@ pub fn expandPath(alloc: Allocator, cmd: []const u8) !?[]u8 {
}; };
defer f.close(); defer f.close();
const stat = try f.stat(); const stat = try f.stat();
if (stat.kind != .Directory and stat.mode & 0o0111 != 0) { if (stat.kind != .directory and stat.mode & 0o0111 != 0) {
return try alloc.dupe(u8, full_path); return try alloc.dupe(u8, full_path);
} }
} }