--ffi manifest fails with SC5002 when the program does not use a binding

Abierto
#3,531 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
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
66/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

Read the check near line 330 in packages/compiler/src/frontend/lowering/native-ffi.ts and the "unused-missing" case in tests/harness/ffi.test.ts. Run that test to confirm the current behavior, then determine whether unused manifest bindings should be accepted or warned about. Done means the shared manifest case behaves as specified and the harness covers it, or a documentation note explains the intentional 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.

--ffi manifest with a binding the program never declares.

// unused.ts
console.log("unrelated");

ffi.json: {"ffi_format":1,"functions":[{"name":"nativeScale","symbol":"native_scale","params":["f64"],"returns":"f64"}],"libraries":[],"system_libraries":[]}

scriptc build unused.ts --ffi ffi.json fails with SC5002: FFI binding 'nativeScale' cannot be resolved: the program has no signature-only function declaration with this name.

Expected: a shared manifest listing bindings for several programs should not fail a program that does not use all of them (or the unused case should be a warning). Today one manifest per entry point is needed. The behavior is pinned by the "unused-missing" case in tests/harness/ffi.test.ts, so if it is intentional, a docs note would help. Check is in packages/compiler/src/frontend/lowering/native-ffi.ts (~line 330).

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.