This repository was archived by the owner on May 21, 2026. It is now read-only.
feat!: Zig 0.16 migration (std.Io API; BREAKING)#24
Merged
Conversation
Adapt to Zig 0.16's unified I/O interface (std.Io). Public reader/writer entry points now take `io: std.Io` as first parameter; obtain it from `std.process.Init.io` or `std.testing.io`. Internal changes: - std.fs.File / std.fs.cwd -> std.Io.File / std.Io.Dir.cwd - std.io.Reader -> std.Io.Reader - std.heap.GeneralPurposeAllocator -> std.heap.DebugAllocator - std.process.argsAlloc -> std.process.Init.minimal.args.toSlice - std.time.Timer -> std.Io.Timestamp / Clock.awake - file.getEndPos / seekTo -> file.length(io) / Reader.seekTo - main signature -> pub fn main(init: std.process.Init) !void
- xdrfile_xtc.zig: classify natoms <= 0 in header as InvalidAtomCount instead of generic ReadError - xdrfile_xtc.zig / xdrfile_trr.zig: clarify why we rewind the reader after probing the header for natoms - CHANGELOG: list missing internal API changes (getEndPos, seekTo, std.time.Timer) and extend the migration example to cover writers - README: show how converter accesses argv via init.minimal.args.toSlice(init.arena.allocator())
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
std.Io).XtcReader.open,XtcWriter.open,TrrReader.open,TrrWriter.open) gain a new first parameterio: std.Io.converterandbenchmarkmigrated to thepub fn main(init: std.process.Init)convention.minimum_zig_version0.15.2 → 0.16.0; package version 0.2.0 → 0.3.0.Breaking change
Callers must thread
iothrough the API. Obtain it fromstd.process.Init.ioinmain, or usestd.testing.ioin tests.CHANGELOG.md has the full migration note.
Internal API mapping
std.heap.GeneralPurposeAllocatorstd.heap.DebugAllocatorstd.fs.cwd()/std.fs.Filestd.Io.Dir.cwd()/std.Io.Filestd.io.Readerstd.Io.Readerstd.process.argsAllocstd.process.Init.minimal.args.toSlicestd.time.Timerstd.Io.Timestamp+Clock.awakefile.getEndPos/file.seekTofile.length(io)/Reader.seekToTest plan
zig build test— 29/29 passzig build validate— 31/31 passzig build cross-format— 32/32 passconverter trr_to_xtc test_data/frame0.trr /tmp/out.xtcsucceeds (501 frames)