Windows: Start Build uses an invalid .cmd path after findBinary refactor
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- node.js, typescript
- Domínio
- build-system, devtools
Direção de pesquisa
Comece lendo findRescriptBinary() e runBuildWatcherUsingValidBuildPath() e, em seguida, rastreie como o caminho ReScript retornado é passado para childProcess.exec no Windows. Verifique se o watcher resolve o launcher existente node_modules/.bin/rescript.cmd sem afetar os outros usos de findRescriptBinary() e confirme que Start Build não sai mais imediatamente.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- ReScript
- Estrelas
- 358
- Forks
- 62
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de rescript-lang/rescript-vscode
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
rescript-lang/rescript-vscode#1185 ·
-
Binary resolution fails on Windows with ERR_INVALID_URL_SCHEME when compiler-info.json is missingAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
rescript-lang/rescript-vscode#1184 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
rescript-lang/rescript-vscode#1192 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 45/100
rescript-lang/rescript-vscode#1182 · 1 comentário ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
rescript-lang/rescript-vscode#1175 ·
Todas as issues de rescript-lang/rescript-vscode
Issues semelhantes
-
Use pnpm 12Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
vercel/ai-elements#524 ·
Mantenedores costumam responder em até 1 dia
-
mock-core-configs/etc/mock/rocky-10-riscv64.cfg contains the wrong architecture in config_opts['root']Talvez já em andamento @jasonmontleon assumiu há 4 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 94/100
rpm-software-management/mock#1834 ·
-
missing `catch.hpp`Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
microsoft/inflatelib#34 · 1 comentário ·
-
status:in-linear
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
n8n-io/n8n#43006 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
is:build
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia