Repository navigation
Fix stale-Deno check on Windows after a failed reconfigure - #15287
Merged
Merged
Conversation
The dev launcher quarto.cmd wrote the pinned Deno version to config/deno-version before calling configure.cmd. If that configure failed before wiping package/dist, the file claimed the new Deno while the old deno.exe stayed on disk, so the stale-Deno check passed on every later run and the reconfigure was never offered again. The write-first order came from the original auto-reconfigure, where configure called back into the launcher and the early write stopped it from looping. The Unix launcher moved the write into configure.sh in 2022; the Windows launcher kept the old order. On Windows the callback no longer matters: configure.cmd only runs `quarto --version`, which returns before the check. configure.cmd now writes the file right after the Deno bootstrap succeeds, as configure.sh does, and the launcher no longer writes it in either branch. A failed reconfigure leaves the previous version in place, so the next run tries again; a successful one records the new version, so one retry is enough. When the file is missing, the launcher now skips the check instead of recording a version it never checked, matching the Unix launcher.
It pinned the choice to skip the stale-Deno check when the file is absent, which is a design decision rather than the reported bug, and would block a later verified write. The failed-reconfigure test still covers the bug.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows, the dev launcher
package/scripts/windows/quarto.cmdchecks that the installed Deno matches theDENOversion inconfiguration, and runsconfigure.cmdwhen it doesn't. It recorded the new version inpackage/dist/config/deno-versionbefore runningconfigure.cmd. When that configure failed, the file claimed the new Deno while the old one was still installed, so every later run skipped the check and kept using the old Deno without asking again.Found while comparing the Windows and Unix bootstrap scripts, not from a user report.
Root cause
The write-first order comes from the original auto-reconfigure (8b3db87), where configure called back into the launcher and the early write prevented a loop. e1fbafb later moved the Unix write into
configure.sh, after Deno is installed, but the Windows launcher kept the old order. The loop concern no longer applies on Windows:configure.cmdonly callsquarto --version, which returns before the check.Fix
configure.cmdnow writesdeno-versionright after Deno is downloaded and extracted, asconfigure.shdoes, and the launcher no longer writes it. A failed reconfigure leaves the previous version in place, so the next run offers the reconfigure again. A successful one records the new version, so one retry is still enough.The launcher also wrote the pinned version when the file was missing, without checking what was installed. That branch is removed: with no file the check is skipped, as in the Unix launcher.
A new Windows-only unit test runs a copy of the launcher in a temporary checkout whose
configure.cmdfails, and checksdeno-versionstill holds the previous version. It fails without the fix.Test plan
configure.cmdon a configured checkout writespackage/dist/config/deno-versionwith the pinned versiondeno-versionset to an older version,package/dist/bin/quarto.cmd --helpreconfigures and asks to retry; the retry runs normallyChecklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.