Skip to content

Commit 41fed25

Browse files
build: fix error message for wrong zig version
previously: ``` [I] ➜ ghostty git:(main) /opt/homebrew/bin/zig build -Demit-macos-app=false /opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/Io/Writer.zig:1198:9: error: ambiguous format string; specify {f} to call format method, or {any} to skip it @CompileError("ambiguous format string; specify {f} to call format method, or {any} to skip it"); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/Io/Writer.zig:700:25: note: called at comptime here try w.printValue( ~~~~~~~~~~~~^ /opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/fmt.zig:629:20: note: called at comptime here dw.writer.print(fmt, args) catch |err| switch (err) { ~~~~~~~~~~~~~~~^~~~~~~~~~~ /opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/fmt.zig:658:83: note: called at comptime here pub inline fn comptimePrint(comptime fmt: []const u8, args: anytype) *const [count(fmt, args):0]u8 { ~~~~~^~~~~~~~~~~ src/build/zig.zig:12:44: note: generic function instantiated here @CompileError(std.fmt.comptimePrint( ~~~~~~~~~~~~~~~~~~~~~^ build.zig:7:24: note: called at comptime here buildpkg.requireZig("0.14.0"); ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ referenced by: root: /opt/homebrew/Cellar/zig/0.15.1/lib/zig/compiler/build_runner.zig:17:26 main: /opt/homebrew/Cellar/zig/0.15.1/lib/zig/compiler/build_runner.zig:366:30 4 reference(s) hidden; use '-freference-trace=6' to see all references src/build/GhosttyResources.zig:16:47: error: struct 'array_list.Aligned(*Build.Step,null)' has no member named 'init' var steps = std.ArrayList(*std.Build.Step).init(b.allocator); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ /opt/homebrew/Cellar/zig/0.15.1/lib/zig/std/array_list.zig:606:12: note: struct declared here return struct { ^~~~~~ ```
1 parent 0c63946 commit 41fed25

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎src/build/zig.zig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ pub fn requireZig(comptime required_zig: []const u8) void {
1010
current_vsn.minor != required_vsn.minor)
1111
{
1212
@compileError(std.fmt.comptimePrint(
13-
"Your Zig version v{} does not meet the required build version of v{}",
14-
.{ current_vsn, required_vsn },
13+
"Your Zig version {s} does not meet the required build version of {s}",
14+
.{ builtin.zig_version_string, required_zig },
1515
));
1616
}
1717
}

0 commit comments

Comments
 (0)