Skip to content

fix: close stdin on vp invocations to avoid Windows runner hang#91

Draft
fengmk2 wants to merge 1 commit into
mainfrom
fix/windows-stdin-hang
Draft

fix: close stdin on vp invocations to avoid Windows runner hang#91
fengmk2 wants to merge 1 commit into
mainfrom
fix/windows-stdin-hang

Conversation

@fengmk2

@fengmk2 fengmk2 commented Jun 28, 2026

Copy link
Copy Markdown
Member

Problem

On Windows runners, setup-vp's vp steps can hang for hours until GitHub cancels the job (issue #90, ref tauri-apps/tauri-action#1308).

Root cause: on Windows CI stdin is not a TTY. Vite+ routes the package-manager .cmd shims (pnpm/npm/yarn) through PowerShell, whose .ps1 wrappers read stdin ($MyInvocation.ExpectingInput) and block forever on an open, empty stdin pipe. @actions/exec leaves the child's stdin open unless input is set, so every vp invocation handed the child a never-closing stdin pipe.

(The primary fix is in Vite+ itself, released in vp 0.1.21. setup-vp defaults to version: latest, so this is a defensive mitigation that also protects users who pin an older vp.)

Fix

Pass an empty Buffer (EOF) as stdin to every vp/sfw invocation so the PowerShell wrappers never block. A Buffer is required (not ""), since @actions/exec only closes stdin when input is truthy.

  • src/utils.ts: new documented EMPTY_STDIN constant.
  • src/run-install.ts: vp install / sfw vp install.
  • src/index.ts: vp env use and vp --version.
  • src/run-install.test.ts: regression test (fails before, passes after).

Closes #90

On Windows runners stdin is not a TTY. Vite+ routes the package-manager
.cmd shims through PowerShell, whose .ps1 wrappers read stdin and block
forever on an open, empty stdin pipe, hanging the job for hours until
GitHub cancels it.

@actions/exec leaves the child's stdin open unless `input` is set, so
pass an empty Buffer (EOF) to every vp/sfw invocation. A Buffer is
required (not ""), since exec only closes stdin when `input` is truthy.

Closes #90
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.

Using on Windows runners will be stuck for several hours until canceled by GitHub

1 participant