Skip to content

feat: update to zig 0.16.0 - #50

Merged
jiacai2050 merged 3 commits into
mainfrom
unknown repository
Apr 17, 2026
Merged

feat: update to zig 0.16.0#50
jiacai2050 merged 3 commits into
mainfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Apr 9, 2026

Copy link
Copy Markdown

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/util.zig

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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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.
@jiacai2050
jiacai2050 merged commit a9f6178 into jiacai2050:main Apr 17, 2026
4 checks passed
@jiacai2050

Copy link
Copy Markdown
Owner

Thanks!

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.

2 participants