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

Abierto Apto para principiantes
#1,164 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
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
macos, node.js, typescript
Área
cli, testing

Línea de trabajo

El caso que falla es la prueba llamada 'the launcher reached through an absolute and a relative symlink' en pstack/skills/statechart/scripts/test/cli.test.ts, alrededor de la línea 135. Lee el helper linkedLauncher, que crea los enlaces bajo os.tmpdir(), y la llamada a path.relative que construye el destino relativo. Ejecuta la prueba con el filtro --test-name-pattern en macOS. Está terminado cuando el directorio temporal se resuelve con realpath antes de construir el enlace relativo y la prueba pasa en macOS y en Linux.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
14.9k
Forks
1.5k
Merge medio
3 h 23 min
PR fusionados (30 d)
143

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

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 cursor/plugins

Todos los issues de cursor/plugins

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.