1
Fork 0

upgrade zig

This commit is contained in:
Motiejus Jakštys 2023-02-24 11:48:02 +02:00
parent 52b4f4b436
commit 6ebe4747ae
2 changed files with 26 additions and 34 deletions

View File

@ -27,14 +27,14 @@ URL_FORMAT_NIGHTLY = "https://ziglang.org/builds/zig-{host_platform}-{version}.{
# which, as of writing, has been quite reliable. # which, as of writing, has been quite reliable.
URL_FORMAT_JAKSTYS = "https://dl.jakstys.lt/zig/zig-{host_platform}-{version}.{_ext}" URL_FORMAT_JAKSTYS = "https://dl.jakstys.lt/zig/zig-{host_platform}-{version}.{_ext}"
_VERSION = "0.11.0-dev.811+8ff9284c4" _VERSION = "0.11.0-dev.1796+c9e02d3e6"
_HOST_PLATFORM_SHA256 = { _HOST_PLATFORM_SHA256 = {
"linux-aarch64": "b47358c3db3df92120e4659c86a653acbdb26fbeb11c97479b28634cbc68cd49", "linux-aarch64": "5902b34b463635b25c11555650d095eb5030e2a05d8a4570c091313cd1a38b12",
"linux-x86_64": "c24550551ac33b78d4f1534ae9dedde5a865c00d9de510e04c9e1e20e77ae18b", "linux-x86_64": "aa9da2305fad89f648db2fd1fade9f0f9daf01d06f3b07887ad3098402794778",
"macos-aarch64": "6fd768eab43dbc2bb3fae92b4c5c4ff538c90819b7c4fdf75bc4f6182d1745b3", "macos-aarch64": "51b4e88123d6cbb102f2a6665dd0d61467341f36b07bb0a8d46a37ea367b60d5",
"macos-x86_64": "5d227db2a9f89b46a940b229d93a53f5331923e676201f44322c1e2ceb62076f", "macos-x86_64": "dd8eeae5249aa21f9e51ff4ff536a3e7bf2c0686ee78bf6032d18e74c8416c56",
"windows-x86_64": "b738ae6549d3a1fdefdd98d0e46fb638d1c5a8284e6c5320f72cbac97d202b37", "windows-x86_64": "260f34d0d5312d2642097bb33c14ac552cd57c59a15383364df6764d01f0bfc9",
} }
_HOST_PLATFORM_EXT = { _HOST_PLATFORM_EXT = {

View File

@ -66,24 +66,25 @@ const EXE = switch (builtin.target.os.tag) {
const CACHE_DIR = "{BAZEL_ZIG_CC_CACHE_PREFIX}"; const CACHE_DIR = "{BAZEL_ZIG_CC_CACHE_PREFIX}";
// cannot use multiline constant syntax due to const usage_cpp =
// https://github.com/ziglang/zig/issues/9257#issuecomment-878534090 \\
const usage_cpp = "" ++ \\Usage: <...>/tools/<target-triple>/{[zig_tool]s}{[exe]s} <args>...
"Usage: <...>/tools/<target-triple>/{[zig_tool]s}{[exe]s} <args>...\n" ++ \\
"\n" ++ \\Wraps the "zig" multi-call binary. It determines the target platform from
"Wraps the \"zig\" multi-call binary. It determines the target platform from\n" ++ \\the directory where it was called. Then sets ZIG_LIB_DIR,
"the directory where it was called. Then sets ZIG_LIB_DIR,\n" ++ \\ZIG_GLOBAL_CACHE_DIR, ZIG_LOCAL_CACHE_DIR and then calls:
"ZIG_GLOBAL_CACHE_DIR, ZIG_LOCAL_CACHE_DIR and then calls:\n" ++ \\
"\n" ++ \\ zig c++ -target <target-triple> <args>...
" zig c++ -target <target-triple> <args>...\n"; ;
const usage_other = "" ++ const usage_other =
"Usage: <...>/tools/<target-triple>/{[zig_tool]s}{[exe]s} <args>...\n" ++ \\Usage: <...>/tools/<target-triple>/{[zig_tool]s}{[exe]s} <args>...
"\n" ++ \\
"Wraps the \"zig\" multi-call binary. It sets ZIG_LIB_DIR,\n" ++ \\Wraps the "zig" multi-call binary. It sets ZIG_LIB_DIR,
"ZIG_GLOBAL_CACHE_DIR, ZIG_LOCAL_CACHE_DIR, and then calls:\n" ++ \\ZIG_GLOBAL_CACHE_DIR, ZIG_LOCAL_CACHE_DIR, and then calls:
"\n" ++ \\
" zig {[zig_tool]s} <args>...\n"; \\ zig {[zig_tool]s} <args>...
;
const Action = enum { const Action = enum {
err, err,
@ -268,10 +269,6 @@ fn getTarget(self_exe: []const u8) error{BadParent}!?[]const u8 {
return null; return null;
} }
fn countWords(str: []const u8) usize {
return mem.count(u8, str, " ") + 1;
}
const testing = std.testing; const testing = std.testing;
pub const TestArgIterator = struct { pub const TestArgIterator = struct {
@ -293,13 +290,8 @@ fn compareExec(
) !void { ) !void {
try testing.expectEqual(want_args.len, res.exec.args.items.len); try testing.expectEqual(want_args.len, res.exec.args.items.len);
// TODO: replace with: for (want_args, res.exec.args.items) |want_arg, got_arg|
// for (prelude, 0..) |arg, i| try testing.expectEqualStrings(want_arg, got_arg);
var i: usize = 0;
for (want_args) |want_arg| {
try testing.expectEqualStrings(want_arg, res.exec.args.items[i]);
i += 1;
}
try testing.expectEqualStrings( try testing.expectEqualStrings(
want_env_zig_lib_dir, want_env_zig_lib_dir,