Closed rhues closed 3 weeks ago
StaticStringMap shouldn't exist in zig 0.12, it was renamed from ComptimeStringMap in a commit in 0.13 nightly. We need to change this to support 0.12.
That would be appreciated! I have a fix for one of the other open tickets, but I can't test and submit a PR until Jetzig is running on Windows.
I found an example of compatibility in cli/commands/generate.zig
starting in line 48.
// XXX: 0.12 Compatibility const map = if (@hasDecl(std, "ComptimeStringMap")) blk: { const inner_map = std.ComptimeStringMap(Generator, .{ .{ "view", .view }, .{ "partial", .partial }, .{ "layout", .layout }, .{ "job", .job }, .{ "mailer", .mailer }, .{ "middleware", .middleware }, .{ "secret", .secret }, }); for (inner_map.kvs) |kv| try available_buf.append(kv.key); break :blk inner_map; } else if (@hasDecl(std, "StaticStringMap")) blk: { const inner_map = std.StaticStringMap(Generator).initComptime(.{ .{ "view", .view }, .{ "partial", .partial }, .{ "layout", .layout }, .{ "job", .job }, .{ "mailer", .mailer }, .{ "middleware", .middleware }, .{ "secret", .secret }, }); for (inner_map.keys()) |key| try available_buf.append(key); break :blk inner_map; } else unreachable;
Maybe something similar can be done in colors.zig.
@rhues There was a blocker for 0.12 compatibility in http.zig (the HTTP server Jetzig uses) which was resolved by this PR - I should be able to get 0.12 compatibility back now.
@rhues Try jetzig update
to update your project to latest main
, I am able to run an app on Windows using Zig 0.12.
Confirmed fixed on commit [b7af4a3]. The project is running on Windows.
When working on Ubuntu Linux, all seems to work fine, but this issue seems to be for Windows only.
With the latest Jetzig, I create a directory, cd to it and run
jetzig init
. The new project appears to be created successfully, along with the two fetch operations. Then I run `zig build run' and get this result:What seems strange to me is this part : error: root struct of file 'std' has no member named 'StaticStringMap' pub const codes_map = std.StaticStringMap(std.io.tty.Color).initComptime(.{