Skip to content

Zig 0.17 - #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.

Builds and tests on Zig 0.17.0, which this makes the minimum.

  • ** is gone: test arrays use @splat.
  • b.findProgram takes .{ .names = ... } and returns an optional.
  • b.install_prefix isn't known when build.zig runs any more, so
    libxev.pc 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.
  • b.build_root is b.root, a path. 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.
  • @typeInfo(...).@"struct".decls is decl_names;
    std.builtin.Type.UnionField.Attributes is std.lang.Type.Union.FieldAttributes.
  • zig fmt upgraded @intFromEnum/@enumFromInt to @backingInt/@fromBackingInt.

One behaviour change to know about: @hasDecl now sees only pub decls,
even from the same file. The "Stream decls" 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 they check again.

The flake takes 0.17.0 from the zig-overlay (nix flake update zig, to
dcffc7a); nothing else in the lock moved.

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

🤖 Generated with Claude Code

endel added 2 commits October 3, 2026 02:21
0.17 drops `**`, findProgram's two-slice form, b.install_prefix and
b.build_root, std.builtin.Type.UnionField, and @typeinfo's decls list,
which is now decl_names. The rest is zig fmt's own upgrade to
@backingInt and @fromBackingInt.

@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 prefix in libxev.pc is no longer known when build.zig runs; it is
relative to the .pc file instead. build.zig declares the directories it
lists, so a new example, benchmark or man page reruns it.

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
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
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