Skip to content

Finish the Zig 0.17 update: CI, nix, libxev.pc and the Stream decls tests - #250

Open
endel wants to merge 2 commits into
mitchellh:mainfrom
endel:zig-0.17
Open

endel wants to merge 2 commits into
mitchellh:mainfrom
endel:zig-0.17

Conversation

@endel

@endel endel commented Oct 3, 2026 •

Copy link
Copy Markdown

Closes #248.

#249 made libxev build on Zig 0.17.0. This is what's left of the update:

  • CI and nix. The workflow still installs 0.16, so every job on main fails. CI, the flake, the README and minimum_zig_version now say 0.17.0. The flake takes 0.17.0 from the zig-overlay (nix flake update zig, to dcffc7a); nothing else in the lock moved.
  • libxev.pc. update to Zig 0.17 #249 commented it out because b.install_prefix isn't known when build.zig runs any more. It now sets prefix=${pcfiledir}/../.., relative to where it is installed. The nix package moves the .pc into its dev output, away from the libraries, so nix/package.nix sets the prefix back to $out.
  • The "Stream decls" tests. @hasDecl now sees only pub decls, even from the same file. These tests began with if (!@hasDecl(Impl, "S")) return;, and S is private, so on 0.17 they returned before checking anything. Every type that runs them has S, so the guard is gone, and decls is now decl_names.
  • build.zig declares the directories it lists (src/bench, examples, docs) with dependOnDirectoryContents, so adding a file to one reruns it under 0.17's configure cache.
  • The rest is zig fmt's upgrade to @backingInt/@fromBackingInt, and the std.lang.Optimize names in build.zig.

Tested: zig build test on macOS (59 passed) and on Linux aarch64 with epoll and io_uring (143 passed, 3 skipped), the examples and benchmarks, and a build for every CI target. In a nixos/nix container (aarch64-linux): nix flake check, the dev shell's zig build for every CI target and its tests, and nix build, whose libxev.pc resolves to the dev output's headers and $out's libraries.

🤖 Generated with Claude Code

https://claude.ai/code/session_015YcSvZdqwMncezgbb64ihg

aherrmann added a commit to hermeticbuild/rules_zig that referenced this pull request Oct 7, 2026
Pinned to a commit requiring Zig 0.17.0:
mitchellh/libxev#250
aherrmann added a commit to hermeticbuild/rules_zig that referenced this pull request Oct 8, 2026
Pinned to a commit requiring Zig 0.17.0:
mitchellh/libxev#250
aherrmann added a commit to hermeticbuild/rules_zig that referenced this pull request Oct 8, 2026
Pinned to a commit requiring Zig 0.17.0:
mitchellh/libxev#250
aherrmann added a commit to hermeticbuild/rules_zig that referenced this pull request Oct 8, 2026
Pinned to a commit requiring Zig 0.17.0:
mitchellh/libxev#250
aherrmann added a commit to hermeticbuild/rules_zig that referenced this pull request Oct 8, 2026
Pinned to a commit requiring Zig 0.17.0:
mitchellh/libxev#250
endel added 2 commits October 21, 2026 16:51
mitchellh#249 made the code build on 0.17, but CI still installs 0.16, so every job
fails. CI, the README and minimum_zig_version now say 0.17.

libxev.pc was dropped because the install prefix is no longer known when
build.zig runs; it now finds its prefix relative to itself. build.zig
declares the directories it lists, so a new example, benchmark or man page
reruns it.

@hasDecl now sees only pub decls, even from the same file, so the "Stream
decls" tests returned before checking anything: S is private. Every type
that runs them has S, so the guard is gone. The rest is zig fmt's own
upgrade to @backingInt and @fromBackingInt.

Assisted-by: Claude Opus 5.5
Most of CI builds inside the flake, so it takes 0.17.0 from a zig-overlay
revision that has it. libxev.pc now finds its prefix relative to itself,
and nix moves it into the dev output, apart from the libraries in $out;
the package sets the prefix back to $out.

Assisted-by: Claude Opus 5.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zig 0.17

1 participant