`rs` command collides with the pre-installed BSD rs (reshape) utility on macOS/BSD, causing a silent, CPU-idle hang
維護者通常 1 天內回覆
@chenjiahan 已經在處理了。
開始於 2026年9月24日。
評估
這個 Issue 還沒有評估資料。
描述
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
[email protected], 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.
- 主要語言
- TypeScript
- 星號
- 28
- 分支
- 1
- 平均合併
- 6 小時 1 分鐘
- 30 天內合併 PR
- 101
環境準備
我們還沒有檢查這個專案的環境設定檔。先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
rstackjs/rstack-cli 的其他 Issue
-
`rstack/types/index.d.ts` references `@rsbuild/core/types` which cannot be resolved under pnpm可能已有人在做 @chenjiahan 於 1 天前認領。 未關閉
rstackjs/rstack-cli#519 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
難度 5/5 一週以上 新手友好度 20/100
rstackjs/rstack-cli#44 ·
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 25/100
rstackjs/rstack-cli#37 ·
維護者通常 1 天內回覆
查看 rstackjs/rstack-cli 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 84/100
diegosouzapw/OmniRoute#14869 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 94/100
維護者通常 1 天內回覆
-
status: waiting triage
難度 2/5 1-3 小時 新手友好度 84/100
freeCodeCamp/freeCodeCamp#70412 ·
維護者通常 1 天內回覆
-
Mend: dependency security vulnerability untriaged
難度 1/5 1 小時以內 新手友好度 88/100
opensearch-project/OpenSearch-Dashboards#12816 ·
維護者通常 1 天內回覆