nodejs / nodejs/node-api-cts

Version-derived feature flags in the node implementor misfire on runtimes that report a fictional Node version

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

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

主要言語
C
スター
18
フォーク
12
PR マージ指標
30日以内にマージされた PR はありません

説明

implementors/node/features.js derives experimentalFeatures.sharedArrayBuffer and
runtimeFeatures.dataviewSharedArrayBuffer from process.version. While exploring how
far foreign runtimes get with the suite, I ran it through the node implementor under
Deno 2.9.5, and its Node compatibility mode reports process.version as v26.3.0, a
Node version that does not exist. The version comparison therefore enables the
SharedArrayBuffer cases, but Deno exports neither node_api_create_sharedarraybuffer
nor node_api_is_sharedarraybuffer, so the addon fails at load time instead of the test
being skipped: on Linux the process exits 127 on the unresolved symbols, and on Windows
dlopen reports it cannot load the addon. The suite output then reads like a broken
test rather than a missing feature. Bun does the same kind of impersonation, its stable
1.3.14 reports v24.3.0 and its current canary also reports v26.3.0, so any invented
version string can end up in these comparisons.

For Node itself the version checks are exactly right, and #26 already made features.js
a per-implementor file, so an eventual bun or deno implementor would declare its own
honest flags. The situation above only exists in the period before such implementors do,
which is also exactly when someone evaluates a new runtime by pointing the node
implementor at it. So a small question rather than a proposal: is that simply out of
scope for the node implementor (worth a sentence in its README that its flags are only
meaningful under real Node), or would you want flags like these derived from a probe of
the actual runtime rather than from the version string? #68 adds one more flag in the
current version-derived style, so whatever you prefer would apply there too. Happy to
help with either outcome.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

implementors/node/features.js と node implementor の README から始め、既存の process.version チェックと #68 の前例を調査します。node implementor が実 Node を前提としていることを文書化するべきか、フラグを有効にする前に機能を検出するべきかを判断してください。選択した動作によって、外部のランタイムがサポートされていない SharedArrayBuffer のケースを試行しないようにできれば完了です。

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

評価

技術スタック
bun, deno, javascript, node.js
領域
testing-qa
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
静か
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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