`rs` command collides with the pre-installed BSD rs (reshape) utility on macOS/BSD, causing a silent, CPU-idle hang
@chenjiahan ya está trabajando en esto.
Desde el 24/9/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Environment
- rstack: 0.8.0
- Node.js: v24.21.0
- pnpm: 12.6.0
- OS: macOS 27
- Package manager mode: pnpm strict node_modules
Summary
On macOS and other BSD-derived operating systems (FreeBSD, NetBSD, OpenBSD), /usr/bin/rs is a standard pre-installed utility (BSD rs — "reshape a data array", part of the base system since 4.2BSD). When Rstack CLI's rs binary is not resolved first on $PATH (e.g. when typed directly in an interactive shell rather than invoked through a package.json script), the shell falls back to the OS-native /usr/bin/rs instead of node_modules/.bin/rs.
Steps to reproduce
- In a project using
rstack@0.8.0, open a plain shell (not throughpnpm run <script>) and run:
rs check
- The command hangs indefinitely with no output.
Ctrl+Cexits with no error message.- Running
npx rs check(which forces resolution to the localnode_modules/.bin/rs) works correctly and completes.
Root cause
BSD's rs utility reads from standard input by default and blocks waiting for piped input when invoked with no valid input stream — this matches the observed symptoms exactly:
- Near-zero CPU usage during the hang (blocked on a
read()call, not computing) - No output before or after interruption
- Resolved entirely by forcing local binary resolution via
npx/pnpm exec
Impact
This affects any BSD-derived OS (macOS included) where /usr/bin/rs precedes the project's node_modules/.bin in $PATH — which is the default shell behavior outside of npm/pnpm script execution contexts. Linux (GNU coreutils-based) is unaffected, as it has no native rs command.
Suggested fix
Since renaming the rs binary would be a breaking change, consider:
- Documenting the
$PATHcollision explicitly in the README, alongside a recommendation to invoke viapnpm exec rs/npx rsrather than a barersin interactive shells - Optionally detecting this collision at runtime (e.g., checking
which rsresolves to the expected package path) and warning the user
Related
This was discovered while investigating what first appeared to be an unrelated hang in rs check --type-check; see #519 for the original (now corrected) report.
- Lenguaje dominante
- TypeScript
- Estrellas
- 28
- Forks
- 1
- Merge medio
- 6 h 1 min
- PR fusionados (30 d)
- 101
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rstackjs/rstack-cli
-
`rstack/types/index.d.ts` references `@rsbuild/core/types` which cannot be resolved under pnpm Abierto
rstackjs/rstack-cli#519 · 1 comentario · 1 asignado ·
-
Rstack CLI Roadmap Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
rstackjs/rstack-cli#44 ·
-
Dependency Dashboard Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
rstackjs/rstack-cli#37 ·
Todos los issues de rstackjs/rstack-cli
Issues similares
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Crush Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
ElementsProject/cln-application#167 · 1 comentario · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Quantco/pnpm-licenses#17 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100