fix: close stdin on vp invocations to avoid Windows runner hang#91
Draft
fengmk2 wants to merge 1 commit into
Draft
fix: close stdin on vp invocations to avoid Windows runner hang#91fengmk2 wants to merge 1 commit into
fengmk2 wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows runners, setup-vp's
vpsteps 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
.cmdshims (pnpm/npm/yarn) through PowerShell, whose.ps1wrappers read stdin ($MyInvocation.ExpectingInput) and block forever on an open, empty stdin pipe.@actions/execleaves the child's stdin open unlessinputis set, so everyvpinvocation 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 everyvp/sfwinvocation so the PowerShell wrappers never block. ABufferis required (not""), since@actions/execonly closes stdin wheninputis truthy.src/utils.ts: new documentedEMPTY_STDINconstant.src/run-install.ts:vp install/sfw vp install.src/index.ts:vp env useandvp --version.src/run-install.test.ts: regression test (fails before, passes after).Closes #90