Windows: `quarto.path` pointing at a `.cmd`-only dev binary is detected as a file but silently falls back to PATH
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 70/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- typescript
- Ambito
- devtools
Direzione di ricerca
Start in packages/quarto-core/src/context.ts, reading detectUserSpecifiedQuarto, detectQuarto, readQuartoInfo, and the useCmd handling around the referenced lines. Reproduce the Windows setup with package/dist/bin/quarto.cmd and the quarto.path setting, then verify that the configured .cmd binary is version-probed and selected rather than silently falling back to PATH.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When the user sets quarto.path to an absolute path of a Quarto build that ships only quarto.cmd on Windows (typical for the in-repo dev binary at package/dist/bin/quarto.cmd after ./configure.cmd), the extension's existence check passes but the subsequent version probe fails. The extension then silently falls back to the system PATH, so the user-specified dev binary is never actually used.
Mechanism
detectUserSpecifiedQuarto validates the file exists and is a file (passes for quarto.cmd), then calls detectQuarto(quartoPath):
readQuartoInfo calls execProgram(quartoPath, ["--version"]). On Windows, child_process spawn on an absolute path to a .cmd file fails without shell: true because Windows requires cmd.exe to interpret .cmd files. The catch block retries with quartoPath + ".cmd" — but when the user already passed …\quarto.cmd, the retry becomes …\quarto.cmd.cmd, which does not exist. Both attempts fail, detectQuarto returns undefined, and the extension falls through to the PATH branch.
There is no warning surfaced — detectUserSpecifiedQuarto only warns when fs.existsSync or isFile checks fail, not when the version probe silently fails:
The useCmd flag only adjusts the execution-time path; it does not help at detection time:
Reproduction
On Windows:
- Clone
quarto-dev/quarto-cli, run./configure.cmd. This producespackage/dist/bin/quarto.cmdwith noquarto.exesibling. - In Positron/VS Code settings, set
quarto.pathto the absolute path of thatquarto.cmd. - Reload the window.
- Open a
.qmdand run any Quarto extension command (Preview, Verify Installation, render).
Observed: the dev binary is not used. The extension picks up whatever quarto is on PATH (in my case, a quarto-prerelease install from Scoop).
Quarto output channel log
[info] Activating Quarto extension.
[info] Searching for Quarto CLI...
[info] Checking quarto.path setting: C:/Users/chris/Documents/DEV_R/quarto-cli.worktrees/issue-14533/package/dist/bin/quarto.cmd
[info] Checking system PATH...
[info] Found Quarto 1.10.3 on system PATH
[info] Using Quarto 1.10.3 from C:\Users\chris\scoop\apps\quarto-prerelease\current\bin (found on system PATH)
[info] Activated Quarto extension.
Note: no warning between the quarto.path check and the PATH fallback. The user has no diagnostic indicating their setting was discarded.
Suggestion
We could either:
- Detect a trailing
.cmdonquartoPathat detection time and spawn withshell: true(or wrap incmd /c). - Or trim the trailing
.cmdfromquartoPathbefore passing toreadQuartoInfo, so the fallback at L208 can append.cmdcleanly without producingquarto.cmd.cmd. - Or at minimum, surface a warning when the existence check passes but the version probe fails, so users get a clear diagnostic instead of silent fallback.
This blocks testing dev binaries against the extension end-to-end on Windows, which is what I hit while validating a quarto-cli fix that surfaces only when the extension is the client. Related to #352, which describes a different mechanism (terminal env-var prepend race on non-bash shells) producing the same user-visible symptom ("quarto.path is ignored").
- Lingua principale
- TypeScript
- Stelle
- 652
- Fork
- 64
- Merge medio
- 8h 45m
- PR unite (30g)
- 36
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 quarto-dev/quarto
-
VS Code extension: `quarto preview` fails when the file path contains parentheses (path not shell-quoted)Forse già presa @Bondrewd-K l’ha presa 2 giorni fa. Apertabug vscode
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
quarto-dev/quarto#1194 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
quarto-dev/quarto#1139 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 90/100
quarto-dev/quarto#1138 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
quarto-dev/quarto#1137 ·
I maintainer di solito rispondono entro 1 giorno
-
Add dependabot?Forse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
quarto-dev/quarto#1135 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di quarto-dev/quarto
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
apache/rocketmq-dashboard#6872 ·
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
fab-geocommuns/RNB-site#539 ·
I maintainer di solito rispondono entro 2 giorni
-
Guest multiview tile label leaks raw virtual-source-id "Whip" instead of the guest name / slot labelAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Eyevinn/open-live-studio#211 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
sujithputta02/Esapay#13 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
ehmpathy/rhachet-roles-bhuild#468 ·
I maintainer di solito rispondono entro 1 giorno