ReviewOS

home-lang/home

Port Bun build --compile nested outfile paths

#632
Closed chris opened this 10 days ago ·
10 days ago

The unchanged Bun corpus file packages/runtime/test/bun-corpus/bundler/cli.test.ts now advances past the JSX warning case and fails the test "generating a standalone binary in nested path, issue #4195".

Current behavior:

  • Bun.spawn invokes Home with build, the trivial JS fixture, --compile, and --outfile pointing at a not-yet-created nested directory.
  • The first compile exits 1 instead of 0.

Required parity:

  • Create every missing parent directory for an absolute outfile such as <tmp>/bun-build-outfile-*/index.exe.
  • Also handle deeper output paths such as <tmp>/bun-build-outfile2-*/b/u/n/index.exe.
  • Emit a runnable standalone executable at the exact requested path.
  • Running each executable must produce no stderr and exit 0.
  • Keep the unchanged upstream workloads and assertions; do not emulate success in the test adapter.

Acceptance:

  • The unchanged packages/runtime/test/bun-corpus/bundler/cli.test.ts nested-path test passes for both output shapes.
  • Neighboring build CLI cases remain green.
10 days ago

Completed in f975227 (fix(test): run compatible standalone builds natively) and pushed to main.

The corpus CLI now deduplicates already-cwd-qualified logical entrypoints and routes compatible single-entry Bun-target build --compile --outfile commands through Home’s real native CLI. This removes the placeholder executable and secondary bundle simulation for this capability: production Home creates each missing nested parent directory, emits the standalone executable at the exact requested path, and the test executes that native artifact.

Validation on the unchanged upstream corpus:

  • zig build debug -Denable_jsc=true
  • bundler/cli.test.ts: 15 pass, 0 fail, 0 unsupported, 2 upstream todos
  • bundler/bun-build-api.test.ts: 45 pass, 0 fail, 0 unsupported, 3 upstream todos
  • direct production probe: deep a/b/index.exe output created, executable printed 84, exit 0
  • git diff --check
  • zig fmt --check packages/home_test/src/corpus_runner.zig

Sign in to comment on this issue.