ReviewOS

home-lang/home

CLI dispatch: preserve config for hyphenated entry files

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

Follow-up to #66. tests/runtime/native-package-run.test.mjs currently passes 37 of 38 aggregate runtime files but loses the expected ENOENT loading tsconfig.json extends debug diagnostic for home run --config -- -option-entry.js --config tail after earlier quiet-config invocations in the same test. The exact command emits the diagnostic when run in isolation under both pinned Bun and Home. The full test fails identically on the unchanged pre-#565 home-release-fast binary and the current debug binary, so this is not caused by worker task shutdown.

Audit persistent config/transpiler cache state keyed through the shared BUN_TMPDIR, especially whether logLevel = "error" from an explicit --config=quiet.toml invocation contaminates a later default bunfig.toml load across child processes. Preserve the exact CLI argument parser behavior and Bun's isolated-command diagnostic. Add a focused sequence regression that runs the quiet and debug cases against one shared cache directory, then restore scripts/runtime-regression.sh to 38/38. Do not weaken the expected warning or clear all caches as a test workaround.

9 days ago

Completed in 59c9f4fe8299eebd82952f39145e1adb799893e7.

The original shared-BUN_TMPDIR/quiet-config hypothesis was disproved: the cache directory remained empty, and the failure reproduced for the exact argv in a fresh process. The actual boundary was Home's native package-or-binary pre-dispatch. A hyphen-leading target can only reach this dispatcher after an explicit --, but it was classified like a bare package-script candidate. That ran the package resolver first with load_tsconfig_json = false; the resolver's process-global DirInfo BSS cache then hid tsconfig semantics and the debug missing-extends diagnostic from the VM.

The dispatcher now treats a readable hyphen-leading runnable target as an explicit entry file, matching relative and absolute entry paths. It reaches the VM without the config-disabled package probe while preserving package-script precedence for ordinary bare names and preserving quiet/default log behavior.

Validation:

  • Exact 20-case config/argv matrix matches pinned Bun at the repaired boundary; the debug case emits ENOENT loading tsconfig.json extends, and the two neighboring run -- ... cases remain quiet.
  • HOME_NATIVE_VM=1 zig-out/bin/home-debug run tests/runtime/native-package-run.test.mjs: pass.
  • HOME_BIN="$PWD/zig-out/bin/home-debug" scripts/runtime-regression.sh: 38/38 passed.
  • zig build test -Dfilter=home_rt -Denable_jsc=true -j1 --summary all: 1,815 passed, 19 skipped, 0 failed; 22/22 build steps. The first attempt stopped during LLVM output with a disk-full infrastructure error; after deleting only stale build artifacts, the identical command passed.
  • zig build debug -Denable_jsc=true -j1 --summary all: 20/20, cached.
  • zig fmt --check packages/runtime/src/runtime/cli/run_command.zig and git diff --check: pass.

This restores the aggregate native runtime regression gate to 38/38 without weakening the diagnostic assertion or clearing caches in the test.

Sign in to comment on this issue.