Skip to content

process: fix execPath detection and spawnSync pipe shutdown#34

Open
artemyarulin wants to merge 2 commits intomainfrom
fix/spawn-process-fork
Open

process: fix execPath detection and spawnSync pipe shutdown#34
artemyarulin wants to merge 2 commits intomainfrom
fix/spawn-process-fork

Conversation

@artemyarulin
Copy link
Contributor

@artemyarulin artemyarulin commented Mar 17, 2026

  • use uv_exepath() for process.execPath, with argv0 fallback
  • ignore UV_EACCES from spawnSync() stdin shutdown on WASIX

After moving subprocesses onto the WASIX spawn model, spawnSync() could still return a successful child result while attaching an EACCES error from pipe shutdown cleanup. process.execPath also needed to follow the Node-style uv_exepath() path.

Depends on wasix-org/libuv#1 I've updated the project to look to the fixed libuv branch

With libuv fix and this PR process.execPath works, spawnSync(process.execPath, ['-e', ...]) works as well and lib test for cross-spawn now doesn't stall anymore

Copy link
Contributor

@theduke theduke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe just fix the EACCESS thing in wasix?

@artemyarulin
Copy link
Contributor Author

Should we maybe just fix the EACCESS thing in wasix?

Probably the right fix would be actually again in libuv: Fix stream.c so uv_shutdown does not call shutdown(SHUT_WR) on stdin pipes created by WASIX spawn, because those are plain pipes, not sockets.

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.

2 participants