Use syntax that builds on both Zig 0.16 and 0.17 - #790
Conversation
Backport the parts of the zig-0.17 port that are valid on 0.16 too, so the port branch only carries what really differs between the versions: - The `**` array repetition operator is gone in 0.17; use `@splat` or an explicit literal instead. - `std.meta.Tuple` is gone in 0.17; `@Tuple` exists in both. - `std.os.linux.getdents64` takes a `c_uint` length in 0.17; clamp and cast. - The Windows `sockaddr` no longer `@bitCast`s from `sockaddr.in` in 0.17; pass the concrete type through a pointer cast.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (11)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughArray and tuple initializers changed across several modules and tests. Linux directory reading now caps the length passed to ChangesZig and OS updates
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Merge Risk: ⚪ Minimal · up to The changes preserve the described initializer values and the inspected filesystem and socket behavior. No concrete merge-blocking issue is established; compatibility with Zig 0.17 remains unverified. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 2 systems. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Zeroes settle into place Comment |
Rebased from the zig-0.17 branch onto main, which by now carries everything from the port that also builds on 0.16 (#790, #791). What is left is what can only be written one way per version: - `netSend`, `netRead` and `netWrite` left `Io.VTable` and became the `net_send`, `net_read` and `net_write` operations, served by both the single-operation and the batch paths. They take the clock along with the timeout, like the other operations on main. - `processSpawnPath`/`processReplacePath` are gone from the vtable, replaced by `inheritParentDir`/`inheritParentFile`; the two tests for the old entry points go with them. - `ip6_only` is `?bool`; null leaves the socket option alone. - `Io.net.UnixAddress.ConnectError` has `ConnectionRefused`, so a refused unix connect is reported as such instead of `error.Unexpected`. - The `AccessDenied` mapping for bind/listen is still blocked upstream, so those markers no longer name the port. - `std.testing.allocator_instance` is a `SafeAllocator` initialized with its backing allocator, and `deinit` returns the leak count.
Rebased from the zig-0.17 branch onto main, which by now carries everything from the port that also builds on 0.16 (#790, #791). What is left is what can only be written one way per version: - `netSend`, `netRead` and `netWrite` left `Io.VTable` and became the `net_send`, `net_read` and `net_write` operations, served by both the single-operation and the batch paths. They take the clock along with the timeout, like the other operations on main. - `processSpawnPath`/`processReplacePath` are gone from the vtable, replaced by `inheritParentDir`/`inheritParentFile`; the two tests for the old entry points go with them. - `ip6_only` is `?bool`; null leaves the socket option alone. - `Io.net.UnixAddress.ConnectError` has `ConnectionRefused`, so a refused unix connect is reported as such instead of `error.Unexpected`. - The `AccessDenied` mapping for bind/listen is still blocked upstream, so those markers no longer name the port. - `std.testing.allocator_instance` is a `SafeAllocator` initialized with its backing allocator, and `deinit` returns the leak count.
* Port the std.Io implementation to Zig 0.17 Rebased from the zig-0.17 branch onto main, which by now carries everything from the port that also builds on 0.16 (#790, #791). What is left is what can only be written one way per version: - `netSend`, `netRead` and `netWrite` left `Io.VTable` and became the `net_send`, `net_read` and `net_write` operations, served by both the single-operation and the batch paths. They take the clock along with the timeout, like the other operations on main. - `processSpawnPath`/`processReplacePath` are gone from the vtable, replaced by `inheritParentDir`/`inheritParentFile`; the two tests for the old entry points go with them. - `ip6_only` is `?bool`; null leaves the socket option alone. - `Io.net.UnixAddress.ConnectError` has `ConnectionRefused`, so a refused unix connect is reported as such instead of `error.Unexpected`. - The `AccessDenied` mapping for bind/listen is still blocked upstream, so those markers no longer name the port. - `std.testing.allocator_instance` is a `SafeAllocator` initialized with its backing allocator, and `deinit` returns the leak count. * Apply zig fmt from Zig 0.17 The 0.17 formatter rewrites the deprecated @intFromEnum/@enumFromInt to @backingInt/@fromBackingInt. Neither exists in 0.16, so this is the one mechanical change that has to stay on the 0.17 side; rerun zig fmt to regenerate it. * Switch CI, docs and minimum version to Zig 0.17 * Point Zig 0.16 users to the zig-0.16 branch * Note the Zig 0.17 requirement in the changelog --------- Co-authored-by: Jan Beelte <jan@beeltek.eu>
First step of making the zig-0.17 port minimal: backport everything from it that is also valid on Zig 0.16.
**array repetition operator is gone in 0.17; use@splator an explicit literal instead.std.meta.Tupleis gone in 0.17;@Tupleexists in both.std.os.linux.getdents64takes ac_uintlength in 0.17; clamp and cast.sockaddrno longer@bitCasts fromsockaddr.inin 0.17; pass the concrete type through a pointer cast.Next step is a small
compat.zigfor the things that need a version check (optimize mode tags, struct field/error set reflection), after which the zig-0.17 branch gets rebased onto main.