execFile callback option timeout has no lowering (SC2020)

Aperta
#3,529 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
57/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
backend, cli

Direzione di ricerca

Start with lowerExecFileCall in packages/compiler/src/frontend/lowering/builtins/child-process.ts and compare callback-form options with the promisified timeout support in child-process-async.ts. Then trace scr_exec_file, scr_exec_file_cwd, and scr_child_kill_signo in packages/runtime/src/scr_child.c to assess where timeout handling fits. Done means the repro kills the child after the requested timeout and the callback receives an error with killed: true, matching Node behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

scriptc 0.4.11, main at 918d80b26a, macOS arm64.

Repro:

import { execFile } from "node:child_process";
execFile("sleep", ["5"], { timeout: 1000 }, (err) => console.log(err ? "killed" : "ok"));

Actual: error SC2020: 'execFile option 'timeout'' is part of the standard library types but has no scriptc lowering yet. The hint lists encoding, maxBuffer, cwd, windowsHide, windowsVerbatimArguments and shell as the only supported callback-form options.

Expected: the child is killed with SIGTERM after the timeout and the callback receives an error with killed: true, as in Node. The promisified form already supports timeout via cp.execCapture (child-process-async.ts).

Pointers: option whitelist in lowerExecFileCall (packages/compiler/src/frontend/lowering/builtins/child-process.ts); the runtime has scr_exec_file/scr_exec_file_cwd and scr_child_kill_signo (packages/runtime/src/scr_child.c) which a timer could use.

Lingua principale
TypeScript
Stelle
6.5k
Fork
212
Merge medio
13h 46m
PR unite (30g)
787

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vercel-labs/scriptc

Tutte le issue di vercel-labs/scriptc

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.