zig.guide icon indicating copy to clipboard operation
zig.guide copied to clipboard

Build failed on Zig 0.15.1

Open daqing opened this issue 1 month ago • 3 comments

I cloned the repo, and I run:

zig build --summary all

and it failed:

Image

daqing avatar Oct 31 '25 10:10 daqing

Zig changed a lot from 0.15.0 to 0.15.1. See https://ziglang.org/download/0.15.1/release-notes.html

evertrol avatar Nov 05 '25 13:11 evertrol

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

georg95 avatar Nov 13 '25 03:11 georg95

Fixed in pull request: https://github.com/Sobeston/zig.guide/pull/324

georg95 avatar Nov 20 '25 21:11 georg95