statechart: relative-symlink launcher test fails on macOS because /var is a symlink

オープン 初心者向け
#1,164 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
macos, node.js, typescript
領域
cli, testing

調査の方向性

失敗しているケースは、pstack/skills/statechart/scripts/test/cli.test.ts の約135行目にある 'the launcher reached through an absolute and a relative symlink' というテストです。os.tmpdir() の下にリンクを作成する linkedLauncher ヘルパーと、相対ターゲットを組み立てる path.relative の呼び出しを読んでください。macOS で --test-name-pattern フィルタを使ってテストを実行します。相対リンクを作る前に一時ディレクトリを realpath で解決し、テストが macOS と Linux の両方で通れば完了です。

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

説明

On macOS, the launcher reached through an absolute and a relative symlink writes the committed chart on this Node in pstack/skills/statechart/scripts/test/cli.test.ts fails. The test before it, which reaches the launcher by its own path, passes.

$ node --disable-warning=ExperimentalWarning --test --test-name-pattern="launcher reached" test/cli.test.ts
✔ the launcher reached by its own path writes the committed chart on this Node
✖ the launcher reached through an absolute and a relative symlink writes the committed chart on this Node
  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
  undefined !== ''
      at cli.test.ts:135:12

Node v26.13.0, macOS. The scripts are copied verbatim from ae5650f.

Cause. linkedLauncher creates its links under os.tmpdir(), which is /var/folders/... on macOS. /var is a symlink to /private/var. path.relative(second, launcher) computes the relative target lexically from /var/folders/.../b. The kernel resolves the link's .. segments from the physical directory, /private/var/folders/.../b, which is one level deeper, so the relative link points at a path that doesn't exist and the spawn fails.

Possible fix. Resolve the temp directory before building the relative link, for example fs.mkdtempSync(path.join(fs.realpathSync(os.tmpdir()), "statechart-links-")).

主要言語
TypeScript
スター
14.9k
フォーク
1.5k
平均マージ
3時間 22分
マージ済み PR(30日)
146

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

cursor/plugins のほかの issue

cursor/plugins の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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