Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update build runner for latest zig master #2111

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions src/build_runner/0.12.0.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;

// -----------------------------------------------------------------------------

Expand Down Expand Up @@ -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..];
}
Expand Down
Loading