Skip to content

chore: port to zig 0.16#23

Merged
laulauland merged 6 commits intomainfrom
lau/zig-0.16
Apr 17, 2026
Merged

chore: port to zig 0.16#23
laulauland merged 6 commits intomainfrom
lau/zig-0.16

Conversation

@laulauland
Copy link
Copy Markdown
Member

Summary

  • Ports drift from Zig 0.15.2 to 0.16.0. Pure API migration, no functional changes.
  • Threads std.Io through every command and VCS callsite, adopts Juicy Main, and renames to the non-deprecated std.Io.Dir.path / std.mem.find* families.
  • Concurrency work using Io.Group / io.async is deferred.

Changes

1. chore: bump to zig 0.16 — mise pin, clap master, min version

  • Adds .mise.toml pinning zig = "0.16.0".
  • build.zig.zon: minimum_zig_version 0.15.0 → 0.16.0.
  • Pins zig-clap to master @ fc1e5cc (first 0.16-capable commit; no tagged release yet).

2. chore: port drift to zig 0.16 — plumbing (juicy main, io threading, writer/path renames) (342+/310−, 12 files)

  • pub fn main()pub fn main(init: std.process.Init); init.gpa replaces GeneralPurposeAllocator.
  • CommandContext gains io: std.Io, threaded through every command.
  • std.fs.cwd() / openFileAbsolute / accessAbsolutestd.Io.Dir.* (takes io).
  • std.fs.File.{stdout,stderr,stdin}std.Io.File.*; file.close()file.close(io).
  • *std.io.Writer*std.Io.Writer.
  • std.process.Child.runstd.process.run(gpa, io, ...) with stdout_limit = .limited(N) (10 callsites in vcs.zig, lint.zig).
  • Child.init + spawn (GitCatFile) → std.process.spawn(io, ...), writeStreamingAll / readerStreaming.
  • ArrayList(T) = .{}.empty; trimLeft/trimRighttrimStart/trimEnd.
  • ArrayList(u8).writer(a)std.Io.Writer.Allocating.
  • std.time.milliTimestamp()std.Io.Timestamp.now(io, .real).toMilliseconds().
  • std.fs.path.relative now takes 5 args: (a, "", null, from, to).
  • file.readToEndAllocfile.reader(io, &.{}).interface.allocRemaining(a, .limited(N)).
  • Test helpers ported: TempRepo takes std.testing.io; Child.Term tag .Exited.exited.

3. chore: rename to non-deprecated std.Io.Dir.path and std.mem.find* (60+/60−)

  • std.fs.path.*std.Io.Dir.path.* (aliased, canonical name).
  • std.mem.indexOf*std.mem.find* (aliased, canonical name).

Testing

  • zig build passes.
  • zig build test passes: 63 tests, 0 failures.
  • drift check runs against the real drift repo and produces the expected stale-anchor output.

Known issues

  • zig-clap is pinned to master @ fc1e5cc because upstream has not tagged a 0.16 release (latest tag 0.11.0 targets Zig 0.15.1). Bump to a tagged release when one ships.

@laulauland laulauland marked this pull request as ready for review April 17, 2026 10:16
@laulauland laulauland merged commit 34e48ac into main Apr 17, 2026
5 checks passed
@laulauland laulauland deleted the lau/zig-0.16 branch April 17, 2026 10:19
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