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

Aperta Adatta ai principianti
#1,164 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
macos, node.js, typescript
Ambito
cli, testing

Direzione di ricerca

Il caso che fallisce è il test chiamato 'the launcher reached through an absolute and a relative symlink' in pstack/skills/statechart/scripts/test/cli.test.ts, intorno alla riga 135. Leggi l'helper linkedLauncher, che crea i link sotto os.tmpdir(), e la chiamata a path.relative che costruisce la destinazione relativa. Esegui il test con il filtro --test-name-pattern su macOS. È completato quando la directory temporanea viene risolta con realpath prima di costruire il link relativo e il test passa su macOS e Linux.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
14.9k
Fork
1.5k
Merge medio
3h 23m
PR unite (30g)
143

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cursor/plugins

Tutte le issue di cursor/plugins

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.