`rs` command collides with the pre-installed BSD rs (reshape) utility on macOS/BSD, causing a silent, CPU-idle hang
@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
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rstackjs/rstack-cli 的其他 Issue
-
rstackjs/rstack-cli#519 · 1 条评论 · 已指派 1 人 ·
-
难度 5/5 一周以上 新手友好度 20/100
rstackjs/rstack-cli#44 ·
-
难度 4/5 3-5 天 新手友好度 25/100
rstackjs/rstack-cli#37 ·
查看 rstackjs/rstack-cli 的全部 Issue
相似的 Issue
-
难度 1/5 1-3 小时 新手友好度 88/100
motiondivision/motion#3849 ·
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 68/100
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
i-am-bee/beeai-framework#1697 · 1 个 reaction ·
-
enhancement
难度 2/5 1-3 小时 新手友好度 75/100
antfu/node-modules-inspector#214 ·