Repository navigation
upgrade to zig 0.17.0 - #64
Merged
Merged
Conversation
marler8997
force-pushed
the
zig-0.17
branch
6 times, most recently
from
October 17, 2026 22:05
fb676a3 to
83c39d0
Compare
Drop support for zig 0.15 and 0.16 and go straight to 0.17.0. - port networking from std.net/std.posix to std.Io; the connect, auth and environment functions now take an io and/or environ (draft.connect(io, environ, buf), connect(io, host), disconnect(io, stream), getDisplay(environ, buf), getAuthFilename(environ, ...), connectUnix(io, path)) - add x11.Address (std.net.Address is gone) and remove socketReader, socketWriter and wsaStartup - remove the zigversion/netpatch/stdext compat shims and examples/Cmdline.zig - getDisplay converts DISPLAY into a caller provided buffer on windows instead of leaking a page_allocator allocation - examples and xauth use zig-staticio (applied with zig-patch) to keep the binaries small; the unit tests use stock std - switch TrueType to codeberg.org/andrewrk/TrueType which supports 0.17 - dbe example waits on the socket with io.operateTimeout instead of std.posix.poll, which no longer compiles for windows - run zig fmt on the whole codebase (mostly the @intFromEnum/@enumFromInt to @backingInt/@fromBackingInt migration) and update the charset generator to produce the formatted output - ci: macos-latest instead of pinning macos-15 Amp-Thread-ID: https://ampcode.com/threads/T-01a14b88-aff8-717e-bb9f-364137832240 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drops zig 0.15/0.16 support and moves to 0.17.0.
Changes
std.Io(std.netis gone in 0.17). Breaking API changes:draft.connect(io, environ, buf),connect(io, host),disconnect(io, stream),getDisplay(environ, buf)(no heap allocation on windows),getAuthFilename(environ, ...),connectUnix(io, path), and a newx11.Addressreplacingstd.net.Address.socketReader/socketWriter/wsaStartupare removed (0.17 doesn't need WSAStartup on windows).codeberg.org/andrewrk/TrueType, which supports 0.17.io.operateTimeoutinstead ofstd.posix.poll, which no longer compiles for windows.zigversion/netpatch/stdextcompat shims andexamples/Cmdline.zig.zig fmton the whole codebase. Most of the diff is its mechanical@intFromEnum/@enumFromInt→@backingInt/@fromBackingInt(@intCast(...))migration. The charset generator was updated to emit the formatted output (regenerating reproduces the files exactly).macos-latestinstead of themacos-15pin, which was only needed for zig 0.15.2.Verification
zig build install test-non-interactivepasses (31/31 unit tests); everything cross-compiles for x86_64/aarch64 windows and macos.getserverfontnames/queryfontoutput, pixel-identical screenshots for all non-animated examples, and the same behavior for unix/TCP/hostname connections, Xauthority cookies and the auth retry/reconnect path.Follow-ups
Pre-existing issues found while testing, both also exist on the 0.15.2 master:
UnexpectedMessage(MobaXterm sendsConfigureNotifyon window creation)EndOfStreamBinary size (stripped, 0.15.2 → 0.17.0 + staticio)
Without staticio, 0.17 small
xauthis 124K andhello226K. The remaining growth vs 0.15.2 is in std's stack trace/log code (e.g.sort.blockis ~100K of ReleaseFasthello); zigx's own networking code got smaller. Clean build times (single run): small 5.7s → 6.2s, fast 22.5s → 28.5s, safe 16.7s → 21.1s, debug ~2.3s unchanged.https://ampcode.com/threads/T-01a14b88-aff8-717e-bb9f-364137832240