Windows: Start Build uses an invalid .cmd path after findBinary refactor
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- node.js, typescript
- 领域
- build-system, devtools
调研方向
先阅读 findRescriptBinary() 和 runBuildWatcherUsingValidBuildPath(),然后跟踪返回的 ReScript 路径在 Windows 上是如何传递给 childProcess.exec 的。验证 watcher 能够解析现有的 node_modules/.bin/rescript.cmd 启动器,同时不影响 findRescriptBinary() 的其他使用方式,并确认 Start Build 不再立即退出。
由索引模型根据 Issue 内容生成。
描述
Summary
Starting a build from the language server fails on Windows because the path returned by findRescriptBinary() no longer matches what runBuildWatcherUsingValidBuildPath() expects.
The build watcher exits immediately with:
Build watcher exited with code 1, signal null
As a result, features that depend on the build watcher (such as fresh type information) do not work until a separate rescript watch process is started manually.
Environment
- OS: Windows 10
- Extension: 1.73.11
- ReScript: 12.3.0 (also reproduced on 12.0.0)
Investigation
In extension version 1.50.0, findRescriptBinary() searched for:
node_modules/.bin/rescript
runBuildWatcherUsingValidBuildPath() then executed:
childProcess.exec(`"${buildPath}".cmd ...`)
which correctly resolved to:
node_modules/.bin/rescript.cmd
The current implementation of findRescriptBinary() returns the package wrapper instead.
For ReScript 12:
node_modules/rescript/cli/rescript.js
For older ReScript versions (10, 11):
node_modules/rescript/rescript
However, runBuildWatcherUsingValidBuildPath() still appends .cmd:
".../node_modules/rescript/cli/rescript.js".cmd
or
".../node_modules/rescript/rescript".cmd
Neither of these files exists.
The actual Windows launcher generated by npm is still:
node_modules/.bin/rescript.cmd
Logs
Starting build watcher for ... (ReScript 12.3.0)
Running build watcher: ...\node_modules\rescript\cli\rescript.js watch
Build watcher exited with code 1, signal null
Possible fix
Since findRescriptBinary() is now also used for purposes other than starting the build watcher (for example, monorepo-related logic), changing it back to return node_modules/.bin/rescript may not be the best approach.
Instead, runBuildWatcherUsingValidBuildPath() could resolve the appropriate Windows launcher from the returned path before calling exec(), preserving the current responsibilities of findRescriptBinary() while restoring the expected Windows behavior.
Related
This appears to be related to issue #1181.
That issue reports that Start Build exits immediately while running rescript watch manually works correctly. My investigation points to the Windows launcher path being constructed from a different kind of path than the code expects.
- 主要语言
- ReScript
- 星标
- 356
- 派生
- 63
- 平均合并
- 11 小时 29 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rescript-lang/rescript-vscode 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
rescript-lang/rescript-vscode#1185 ·
-
Binary resolution fails on Windows with ERR_INVALID_URL_SCHEME when compiler-info.json is missing未关闭
难度 2/5 1-3 小时 新手友好度 76/100
rescript-lang/rescript-vscode#1184 ·
-
难度 3/5 1-2 天 新手友好度 58/100
rescript-lang/rescript-vscode#1192 ·
-
难度 2/5 1-3 小时 新手友好度 45/100
rescript-lang/rescript-vscode#1182 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
rescript-lang/rescript-vscode#1175 ·
查看 rescript-lang/rescript-vscode 的全部 Issue
相似的 Issue
-
0.kind: build failure
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
help wanted
难度 2/5 1-3 小时 新手友好度 70/100
meshery-extensions/meshery-mcp-server#63 · 1 条评论 ·
-
help wanted
难度 2/5 1-3 小时 新手友好度 62/100
-
package-update
难度 2/5 1-3 小时 新手友好度 62/100
oSoWoSo/vOid_Community_repOsitory#436 · 1 条评论 ·
维护者通常 1 天内回复
-
devops good first issue
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复