Windows: Start Build uses an invalid .cmd path after findBinary refactor
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- node.js, typescript
- Ambito
- build-system, devtools
Direzione di ricerca
Inizia leggendo findRescriptBinary() e runBuildWatcherUsingValidBuildPath(), quindi segui il modo in cui il percorso ReScript restituito viene passato a childProcess.exec su Windows. Verifica che il watcher risolva il launcher esistente node_modules/.bin/rescript.cmd senza compromettere gli altri utilizzi di findRescriptBinary(), e conferma che Start Build non termini più immediatamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- ReScript
- Stelle
- 354
- Fork
- 63
- Merge medio
- 11h 29m
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rescript-lang/rescript-vscode
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rescript-lang/rescript-vscode#1185 ·
-
Binary resolution fails on Windows with ERR_INVALID_URL_SCHEME when compiler-info.json is missing Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
rescript-lang/rescript-vscode#1184 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
rescript-lang/rescript-vscode#1192 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
rescript-lang/rescript-vscode#1182 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rescript-lang/rescript-vscode#1175 ·
Tutte le issue di rescript-lang/rescript-vscode
Issue simili
-
comp/dashboard P3 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
NousResearch/hermes-agent#117722 ·
-
Use zstd compression? ApertaNeeds Design Priority: Wishlist
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
elementary/flatpak-platform#253 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
objectionary/hone-maven-plugin#1060 ·
-
0.kind: build failure
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Update Vish to 1.1.5 Apertapackage-update
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
oSoWoSo/vOid_Community_repOsitory#144 · 1 commento ·