From f7c8d9a89af875c57d1a67e9fc3a4c7ab3125aa5 Mon Sep 17 00:00:00 2001 From: Lee Cannon Date: Tue, 17 Dec 2024 18:36:38 +0000 Subject: [PATCH 1/2] update build runner for latest zig master --- build.zig | 4 ++-- build.zig.zon | 2 +- flake.lock | 12 ++++++------ src/build_runner/0.12.0.zig | 13 ++++++++++--- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/build.zig b/build.zig index 601ef7949..0d8f25ed0 100644 --- a/build.zig +++ b/build.zig @@ -6,7 +6,7 @@ const builtin = @import("builtin"); const zls_version = std.SemanticVersion{ .major = 0, .minor = 14, .patch = 0, .pre = "dev" }; /// Specify the minimum Zig version that is required to compile and test ZLS: -/// compiler: remove anonymous struct types, unify all tuples +/// Sema: disallow unsafe in-memory coercions #22243 /// /// If you do not use Nix, a ZLS maintainer can take care of this. /// Whenever this version is increased, run the following command: @@ -15,7 +15,7 @@ const zls_version = std.SemanticVersion{ .major = 0, .minor = 14, .patch = 0, .p /// ``` /// /// Must match the `minimum_zig_version` in `build.zig.zon`. -const minimum_build_zig_version = "0.14.0-dev.2088+3f7fac5ff"; +const minimum_build_zig_version = "0.14.0-dev.2506+32354d119"; /// Specify the minimum Zig version that is required to run ZLS: /// Release 0.12.0 diff --git a/build.zig.zon b/build.zig.zon index 227dae2b2..d3ecc1eee 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -3,7 +3,7 @@ // Must match the `zls_version` in `build.zig` .version = "0.14.0-dev", // Must match the `minimum_build_zig_version` in `build.zig` - .minimum_zig_version = "0.14.0-dev.2088+3f7fac5ff", + .minimum_zig_version = "0.14.0-dev.2506+32354d119", // If you do not use Nix, a ZLS maintainer can take care of this. // Whenever the dependencies are updated, run the following command: // ```bash diff --git a/flake.lock b/flake.lock index 1a00f3beb..d0f77e352 100644 --- a/flake.lock +++ b/flake.lock @@ -74,11 +74,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1733412085, - "narHash": "sha256-FillH0qdWDt/nlO6ED7h4cmN+G9uXwGjwmCnHs0QVYM=", + "lastModified": 1734323986, + "narHash": "sha256-m/lh6hYMIWDYHCAsn81CDAiXoT3gmxXI9J987W5tZrE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4dc2fc4e62dbf62b84132fe526356fbac7b03541", + "rev": "394571358ce82dff7411395829aa6a3aad45b907", "type": "github" }, "original": { @@ -135,11 +135,11 @@ ] }, "locked": { - "lastModified": 1733487143, - "narHash": "sha256-o4jsVKtInTA0CqwUUdcAxCYAgNLLNo30mLzz3qVc0eY=", + "lastModified": 1734437548, + "narHash": "sha256-b0mWbOhNuu9m9siL9nCFdzNFmpNPF0+KX22OECk5jpY=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "40e32dd7e083eab4340acd17de47f13d883f257f", + "rev": "007fae6a7dbbc26f0165c4590b81362597c31413", "type": "github" }, "original": { diff --git a/src/build_runner/0.12.0.zig b/src/build_runner/0.12.0.zig index d8e0ca9bd..49c5b57dd 100644 --- a/src/build_runner/0.12.0.zig +++ b/src/build_runner/0.12.0.zig @@ -41,6 +41,8 @@ const live_rebuild_processes = std.SemanticVersion.parse("0.14.0-dev.310+9d38e82b5") catch unreachable; const file_watch_windows_version = std.SemanticVersion.parse("0.14.0-dev.625+2de0e2eca") catch unreachable; +const child_type_coercion_version = + std.SemanticVersion.parse("0.14.0-dev.2506+32354d119") catch unreachable; // ----------------------------------------------------------------------------- @@ -775,20 +777,25 @@ fn workerMakeOneStep( } } -fn nextArg(args: [][:0]const u8, idx: *usize) ?[:0]const u8 { +const ArgsType = if (builtin.zig_version.order(child_type_coercion_version) == .lt) + [][:0]const u8 +else + []const [:0]const u8; + +fn nextArg(args: ArgsType, idx: *usize) ?[:0]const u8 { if (idx.* >= args.len) return null; defer idx.* += 1; return args[idx.*]; } -fn nextArgOrFatal(args: [][:0]const u8, idx: *usize) [:0]const u8 { +fn nextArgOrFatal(args: ArgsType, idx: *usize) [:0]const u8 { return nextArg(args, idx) orelse { std.debug.print("expected argument after '{s}'\n access the help menu with 'zig build -h'\n", .{args[idx.* - 1]}); process.exit(1); }; } -fn argsRest(args: [][:0]const u8, idx: usize) ?[][:0]const u8 { +fn argsRest(args: ArgsType, idx: usize) ?ArgsType { if (idx >= args.len) return null; return args[idx..]; } From 69df1fb8ca6f3560c27bcf1b17ebe94c2e60023e Mon Sep 17 00:00:00 2001 From: Techatrix Date: Wed, 18 Dec 2024 01:25:20 +0100 Subject: [PATCH 2/2] revert minimum runtime version to `0.14.0-dev.2088+3f7fac5ff` --- build.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index 0d8f25ed0..601ef7949 100644 --- a/build.zig +++ b/build.zig @@ -6,7 +6,7 @@ const builtin = @import("builtin"); const zls_version = std.SemanticVersion{ .major = 0, .minor = 14, .patch = 0, .pre = "dev" }; /// Specify the minimum Zig version that is required to compile and test ZLS: -/// Sema: disallow unsafe in-memory coercions #22243 +/// compiler: remove anonymous struct types, unify all tuples /// /// If you do not use Nix, a ZLS maintainer can take care of this. /// Whenever this version is increased, run the following command: @@ -15,7 +15,7 @@ const zls_version = std.SemanticVersion{ .major = 0, .minor = 14, .patch = 0, .p /// ``` /// /// Must match the `minimum_zig_version` in `build.zig.zon`. -const minimum_build_zig_version = "0.14.0-dev.2506+32354d119"; +const minimum_build_zig_version = "0.14.0-dev.2088+3f7fac5ff"; /// Specify the minimum Zig version that is required to run ZLS: /// Release 0.12.0