Build failed on Zig 0.15.1
I cloned the repo, and I run:
zig build --summary all
and it failed:
Zig changed a lot from 0.15.0 to 0.15.1. See https://ziglang.org/download/0.15.1/release-notes.html
There's bunch things to change to make it work
For example:
error: struct 'array_list.Aligned([]const u8,null)' has no member named 'init'
This is deprecated in zig 0.15, 0.16, but as a quick fix will work until some release in future. Properly rewriting code with allocators not as easy.
replace std.ArrayList -> std.array_list.Managed
- var test_file_paths = std.ArrayList([]const u8).init(allocator);
+ var test_file_paths = std.array_list.Managed([]const u8).init(allocator);
error: no field named 'root_source_file' in struct 'Build.TestOptions'
const unit_tests = b.addTest(.{
+ const unit_tests = b.addTest(.{ .root_module = b.createModule(.{
.root_source_file = test_lazypath,
.target = target,
.optimize = optimize,
- });
+ }) });
and some more
Fixed in pull request: https://github.com/Sobeston/zig.guide/pull/324