ReviewOS

home-lang/home

Port Bun comprehensive subprocess matrix

#163
Closed chris opened this 9 days ago ·
9 days ago

Port the exact upstream test/js/bun/spawn/spawn.test.ts comprehensive subprocess corpus into Home without whole-file TODO rewriting.

This umbrella tracks focused implementation slices for:

  • spawn/spawnSync inputs, outputs, exit and onExit
  • pipes, files, blobs, killing, unref, and disposal
  • close handling and caller-owned extra stdio
  • extra stdio blob/stream validation and socket-fd ownership
  • IPC disconnect behavior
  • argv0, detached, and option combinations

Acceptance:

  • corpus remains byte-identical to ~/Code/bun
  • every active upstream case passes with 0 fail and 0 unsupported
  • explicit upstream skips/TODOs remain explicit
  • adjacent focused spawn matrices remain green
  • full home_test gate passes
9 days ago

Completed and pushed directly to main in 71e49c00f.

Implemented the comprehensive Bun subprocess matrix without whole-file TODO rewriting:

  • spawn/spawnSync argv0 behavior, invalid-command errors, finite sleep/kill/unref lifecycles, async disposal, and onExit stress
  • file-, Blob-, byte-, and pipe-backed stdin/stdout, including full payload preservation beyond the native 128 KiB capture boundary
  • IPC messages, disconnect callbacks, advanced-serialization option combinations, and detached + argv0
  • caller-owned stdio descriptors, extra-slot normalization, socket-fd ownership, virtual readSync/fstatSync, and durable EBADF errors
  • Blob/Response/Request/ReadableStream stdio validation with Bun-compatible error messages
  • shared console.count/countReset support
  • a durable exact-file regression in the Zig suite

Verification:

  • upstream corpus is byte-identical to ~/Code/bun/test/js/bun/spawn/spawn.test.ts
  • exact corpus: 126 passed, 0 failed, 0 unsupported, 5 upstream TODO
  • ./pantry/.bin/zig build debug --summary failures: pass
  • ./pantry/.bin/zig build test -Dfilter=home_test --summary failures: pass from a clean local Zig cache
  • Zig formatting and diff checks: pass

The full gate also caught and drove the fix for an ordering-sensitive 128 KiB stdout truncation that the isolated corpus did not reproduce.

Sign in to comment on this issue.