execFile callback option timeout has no lowering (SC2020)

Abierto
#3,529 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
57/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
node.js, typescript
Área
backend, cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
6.5k
Forks
212
Merge medio
13 h 46 min
PR fusionados (30 d)
787

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de vercel-labs/scriptc

Todos los issues de vercel-labs/scriptc

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.