Skip to content

Commit

Permalink
merge: #4019
Browse files Browse the repository at this point in the history
4019: fix: ignore stdin in execa r=sprutton1 a=sprutton1

This stops execa from waiting for stdin, so we no longer just hang forever if someone writes a function that does something cool like `cat` with no input.

This also moves the execaOptions out of siExec because letting people configure this inside of functions seems rife for mischief. 

<img src="https://media4.giphy.com/media/0XejaeIG6jJWkJzZJK/giphy.gif"/>

Co-authored-by: Scott Prutton <[email protected]>
  • Loading branch information
si-bors-ng[bot] and sprutton1 authored Jun 22, 2024
2 parents 645f1ea + a84e6b6 commit c72da36
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bin/lang-js/src/sandbox/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export const makeExec = (executionId: string) => {
async function waitUntilEnd(
execaFile: string,
execaArgs?: readonly string[],
execaOptions?: Options<string>,
): Promise<SiExecResult> {
const execaOptions: Options<string> = { stdin: 'ignore' };
debug(
`running command; executionId="${executionId}"; cmd="${execaFile} ${execaArgs
?.map((a) => `'${a}'`)
Expand Down Expand Up @@ -74,7 +74,6 @@ export const makeExec = (executionId: string) => {
const c = await waitUntilEnd(
options.cmd,
options.args,
options.execaOptions,
);
// Update the count of how many attempts we have made
deadlineCount += 1;
Expand Down

0 comments on commit c72da36

Please sign in to comment.