feat: update to zig 0.16.0 - #50
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the project to support Zig 0.16.0. The changes include updating the main function signature in examples to accept std.process.Init, migrating filesystem and IO operations to the new std.Io API, and refactoring build logic to use root_module. A critical issue was identified in src/util.zig where the ResizableBuffer type alias needs to be updated to std.ArrayList(u8) because std.array_list.Managed has been removed in the new Zig version.
|
|
||
| pub fn allocCABundle(allocator: std.mem.Allocator) !ResizableBuffer { | ||
| var bundle: std.crypto.Certificate.Bundle = .{}; | ||
| pub fn allocCABundle(allocator: std.mem.Allocator, io: std.Io) !ResizableBuffer { |
There was a problem hiding this comment.
As you correctly suspected in the pull request description, std.array_list.Managed has been removed in Zig 0.16.0. The ResizableBuffer type alias, which is used as the return type here, will cause a compilation failure.
You should update the ResizableBuffer alias to use std.ArrayList(u8) instead. This change needs to be made on line 7 of this file.
pub const ResizableBuffer = std.ArrayList(u8);std.ArrayList is the new replacement and its API is compatible with how ResizableBuffer is used throughout the codebase.
Upgrade zig toolchain to ensure compatibility with latest features and bug fixes. This change helps maintain project stability and prepares for upcoming zig releases.
Clarify usage of stdoutWriteCallback to require setWritedata with a *const std.Io. This change improves documentation accuracy and enforces correct handling of streaming writes, reducing misuse and potential errors with response body processing.
|
Thanks! |
0.16.0 is close to getting tagged (AFAIK some point next week), with release notes being prepared, so this is in preparation for that. Still, perhaps might want to hold off on merging this until it gets tagged in case of a surprise break (I am suspecting one may come in full removal of Managed ArrayList, thus affecting the CA Bundle, but not certain)
Library isn't too affected by the Iogate, with the main breakage being in the build system and
allocCABundle(...), other than that things remain the same for downstream users.Tested on Linux 6.12.62.
edit: CI currently fails due to no 0.16.0 precompiled binary