Skip to content

fix: update build.zig for new std.ArrayList API#526

Open
lee101 wants to merge 2 commits intoneurocyte:masterfrom
lee101:update-zig-arraylist-api
Open

fix: update build.zig for new std.ArrayList API#526
lee101 wants to merge 2 commits intoneurocyte:masterfrom
lee101:update-zig-arraylist-api

Conversation

@lee101
Copy link

@lee101 lee101 commented Mar 1, 2026

Summary

  • Replace std.ArrayList.writer() pattern with direct *std.ArrayList parameters and .print() method calls in build.zig
  • Updates gen_version and gen_version_info function signatures accordingly
  • Fixes compatibility with newer zig versions that changed the ArrayList API

Test plan

  • Verify zig build compiles successfully with the target zig version

🤖 Generated with Claude Code

Replace .writer() pattern with direct *std.ArrayList and .print() method
calls to support newer zig versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lee101
Copy link
Author

lee101 commented Mar 1, 2026

hi just bumping to support zig 0.16.0-dev thx (one more commit coming)

b: *std.Build,
target: std.Build.ResolvedTarget,
writer: anytype,
out: *std.ArrayList(u8),
Copy link
Owner

Choose a reason for hiding this comment

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

This is not the right fix. The gen_* functions should keep taking a writer, but it should be changed to a concrete std.Io.Writer

And the ArrayList that is written to should be changed into a std.Io.Writer.Allocating

Migrate from removed/renamed APIs: std.io -> std.Io,
ArrayList.writer() -> ArrayList.print(), fixedBufferStream ->
Io.Writer.fixed, File.readToEndAlloc -> reader().interface.allocRemaining,
std.fmt.Formatter -> inline struct, MemoryAccessor removal, and
generic Writer/BufferedWriter type removal.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@neurocyte
Copy link
Owner

Where does this get us? Fully building with the latest zig? What about all the dependencies?

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