Skip to content

Upgrade zig 0.15.2#1

Draft
tammoippen wants to merge 5 commits intomasterfrom
upgrade-zig-0.15.2
Draft

Upgrade zig 0.15.2#1
tammoippen wants to merge 5 commits intomasterfrom
upgrade-zig-0.15.2

Conversation

@tammoippen
Copy link
Owner

@tammoippen tammoippen commented Feb 7, 2026

No description provided.

tammoippen and others added 5 commits February 7, 2026 11:10
- Replace addStaticLibrary/addSharedLibrary with addLibrary
- Add linkage parameter (.static/.dynamic) to library definitions
- Update test filter to be set on test object instead of in options

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Change ArrayList.init(allocator) to .{} syntax
- Update deinit() to deinit(allocator) with allocator parameter
- Update append() to append(allocator, item)
- Update appendNTimes() to appendNTimes(allocator, value, n)
- Update writer() to writer(allocator)
- Update Histogram.deinit signature to include allocator parameter

These changes reflect the Zig 0.15.2 ArrayList API where the allocator
is passed to each method rather than stored in the struct.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Change {} to {any} for types with custom format methods
- Use {any:width} syntax for custom formatters with options
- Update test code to use {any} instead of {s} for Dots types

Zig 0.15.2 requires explicit format specifiers when printing types
that implement custom format methods. Using {any} calls the format
method, while bare {} is now ambiguous and rejected.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace std.io.getStdOut().isTty() with std.posix.isatty(std.posix.STDOUT_FILENO)

In Zig 0.15.2, the I/O module was restructured and getStdOut() was
removed. The isatty check is now available through the posix module.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Change format method signatures from (self, fmt, options, writer) to (self, writer)
- Update all format specifiers from {any} to {f} to call custom format methods
- Replace writeByteNTimes with splatByteAll (new API in 0.15.2)
- Add HistogramFormatter wrapper to support custom widths with {f} specifier
- Update tests to use {f} format specifier and withWidth() helper

In Zig 0.15.2, the format system changed:
- {f} calls the format method with simplified (self, writer) signature
- {any} bypasses custom formatters and prints struct fields
- Format methods no longer receive fmt/options parameters

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant