Skip to content

Migrate to Zig 0.16.0 and bump vittest to 4.1.5#5

Open
yeongjukang wants to merge 2 commits intopithings:mainfrom
yeongjukang:main
Open

Migrate to Zig 0.16.0 and bump vittest to 4.1.5#5
yeongjukang wants to merge 2 commits intopithings:mainfrom
yeongjukang:main

Conversation

@yeongjukang
Copy link
Copy Markdown

@yeongjukang yeongjukang commented May 4, 2026

Hello, thank you for creating this package. I updated code to support Zig 0.16.0.

Changes

  • build.zig
    • addRemoveDirTree was removed with no direct replacement in the build system API
    • addSystemCommand with platform-appropriate
      rm/rmdir
  • build.zig.zon
    • bump minimum_zig_version to 0.16.0
  • pty_linux.zig
    • std.fs.openDirAbsolute was removed so replaced
      it with raw linux.open and linux.getdents64
      syscalls
    • std.fs.openFileAbsolute and std.posix.readlink
      replaced with raw linux syscalls
    • bufPrint --> bufPrintZ for null-terminated paths
      required by raw syscalls
    • linux.E.init() --> linux.errno()
    • use .empty to initialize ArrayListUnmanaged
  • pty_darwin.zig
    • use .empty to initialize ArrayListUnmanaged
    • @intFromEnum/@enumFromInt to handle SIG
      constants in resetSignalHandlers
  • pty_windows.zig
    • use .empty to initialize ArrayListUnmanaged
    • Windows BOOL comparisons use .toBool()
    • OpenProcess second arg: 0 --> .FALSE
    • windows.HRESULT to local i32 alias
  • vitest
    • 4.1.3 to 4.1.5

zigpty [main●] % bun run test
$ zig build test && vitest run

 RUN  v4.1.5 /Users/yeongju/zigpty

 ✓ src/terminal.test.ts (17 tests) 898ms
 ✓ src/spawn.test.ts (30 tests | 1 skipped) 2764ms
     ✓ should intercept default XOFF/XON when handleFlowControl is true  512ms
     ✓ should not intercept flow control when disabled  312ms
     ✓ should stop receiving data after dispose  611ms
 ✓ src/pipe.test.ts (40 tests | 2 skipped) 4115ms
     ✓ should stop receiving data after dispose  721ms

 Test Files  3 passed (3)
      Tests  84 passed | 3 skipped (87)
   Start at  14:33:40
   Duration  4.32s (transform 152ms, setup 0ms, import 222ms, tests 7.78s, environment 0ms)

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