Fix build with Zig 0.17.0 - #719
Merged
Merged
Conversation
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.
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`.
Member
Author
|
@AlbertShown Hey, can you merge this? The zig |
AlbertShown
approved these changes
Oct 5, 2026
Member
|
Thank you @jinzhongjia for the Zig upgrade |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #703. With the Zig 0.17.0 release,
build.zigstill fails to compile, both for this repository and for every package that depends on webui (for example zig-webui):Changes
std.builtin.OptimizeModetostd.lang.Optimizeand lowercased its tags.addLinkerFlagsnow picks.debugor.Debugbased on the Zig version.zig build examplesdid not notice example directories added or removed underexamples/Cafter the first run. The directory listing is now declared withb.dependOnDirectoryContents.0.17.0to the Zig matrix, alongside0.16.0.Verification (macOS arm64, Zig 0.16.0 and 0.17.0)
zig build -Dverbose=debugzig build -Ddynamic -Dverbose=debugzig build exampleszig build -Doptimize=ReleaseSafezig fmt --check build.zig-Ddebug=civetwebdrops-DNDEBUGin Debug and keeps it in ReleaseSafe, so thedebugcheck behaves the same as before.examples/C/<new>is now picked up by the nextzig build examples; before this change the new example was silently skipped.zig fmtwants to rewrite the existing@intFromEnumcalls to@backingInt, which does not exist on 0.16.@intFromEnumis only deprecated on 0.17, so it is kept as is.