ReviewOS

home-lang/home

Keep temporary node-gyp shims bound to the active runtime

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

Problem

The unchanged lifecycle case ensureTempNodeGypScript works fails because the generated temporary node-gyp shim invokes bun, but the lifecycle child PATH cannot resolve the Home executable:

.../.bun-tmp/...node-gyp/node-gyp: line 3: bun: command not found
error: preinstall script from "foo" exited with 127

The test deliberately restores the original PATH before spawning and expects the runtime-created shim to remain executable. Adding a test PATH entry would be a workaround and is not acceptable.

Reproduction:

scripts/provision-corpus-deps.sh
HOME_NATIVE_VM=1 HOME_CORPUS_FULL_VM=1 ./zig-out/bin/home test packages/runtime/test/bun-corpus/cli/install/bun-install-lifecycle-scripts.test.ts

Current unchanged ReleaseFast file: 48 pass / 12 fail / 699 assertions; this is the single node-gyp PATH failure.

Acceptance criteria

  • Temporary node-gyp wrappers resolve the active Home runtime using the same self-executable contract as pinned Bun.
  • The unchanged lifecycle case passes in Debug and ReleaseFast with its original PATH manipulation.
  • Copied/renamed runtime executables continue to use their active binary identity correctly.
  • No global bun dependency, PATH injection in tests, wrapper fixture rewrite, or fallback to installed Bun.

Related: #66, #518.

9 days ago

Resolved on main by 78cad9f. Temporary node and Bun shims are now colocated in the directory actually prepended to PATH, so the generated node-gyp wrapper stays bound to the active Home runtime even when the incoming PATH is empty. The unchanged ensureTempNodeGypScript lifecycle test passes 1/1 with 5 assertions in both Debug and ReleaseFast.

Sign in to comment on this issue.