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

オープン
#3,531 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
66/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
TypeScript
スター
6.5k
フォーク
212
平均マージ
13時間 46分
マージ済み PR(30日)
787

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vercel-labs/scriptc のほかの issue

vercel-labs/scriptc の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。