From 57e2c1e88599c196a88e7928f853eb4e35a4c061 Mon Sep 17 00:00:00 2001 From: jinzhongjia Date: Mon, 5 Oct 2026 19:53:59 +0800 Subject: [PATCH 1/3] fix(build): support Zig 0.17 optimize mode tags Zig 0.17 renamed `std.builtin.OptimizeMode` to `std.lang.Optimize` and lowercased its tags, so comparing against `.Debug` no longer compiles. This breaks every package that depends on webui as well. Pick the tag by Zig version to keep 0.16 building. --- build.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index 57b66a2dd..05cd0fa8b 100644 --- a/build.zig +++ b/build.zig @@ -80,7 +80,8 @@ fn addLinkerFlags( const webui_target = webui.rootModuleTarget(); const is_windows = webui_target.os.tag == .windows; const is_darwin = webui_target.os.tag == .macos; - const debug = webui.root_module.optimize.? == .Debug; + // Zig 0.17 renamed `OptimizeMode` to `Optimize` with lowercase tags. + const debug = webui.root_module.optimize.? == if (comptime builtin.zig_version.minor >= 17) .debug else .Debug; // In Zig 0.16, methods like addCSourceFile/linkLibC/addIncludePath/linkSystemLibrary/ // linkFramework/addCMacro were removed from *Compile and live only on *Module. // Routing every call through `mod` keeps the build script compatible with 0.14/0.15/0.16. From bf74d563e1cd7f19043049888405dbbc2ffce63a Mon Sep 17 00:00:00 2001 From: jinzhongjia Date: Mon, 5 Oct 2026 19:53:59 +0800 Subject: [PATCH 2/3] fix(build): track examples/C in the Zig 0.17 configure cache Zig 0.17 caches the configure phase, so `zig build examples` did not pick up example directories added or removed after the first run. Declare the directory listing with `dependOnDirectoryContents`. --- build.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.zig b/build.zig index 05cd0fa8b..b144e93a4 100644 --- a/build.zig +++ b/build.zig @@ -186,6 +186,10 @@ fn build_examples(b: *Build, webui: *Compile) !void { }; defer examples_dir.close(io); + // Zig 0.17 caches the configure phase; re-run it when an example + // directory is added or removed. + b.dependOnDirectoryContents(b.path("examples/C")); + var paths = examples_dir.iterate(); while (try paths.next(io)) |val| { if (val.kind != .directory) continue; From d526574a194cd8f52d296a3721dbeaa3e17ae32b Mon Sep 17 00:00:00 2001 From: jinzhongjia Date: Mon, 5 Oct 2026 19:54:18 +0800 Subject: [PATCH 3/3] ci: build with Zig 0.17.0 --- .github/workflows/zig.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/zig.yml b/.github/workflows/zig.yml index c63b5a466..6fa6bc65b 100644 --- a/.github/workflows/zig.yml +++ b/.github/workflows/zig.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - version: [0.16.0] + version: [0.16.0, 0.17.0] fail-fast: false runs-on: ${{ matrix.os }} steps: