Skip to content

Fix stale-Deno check on Windows after a failed reconfigure - #15287

Merged
cderv merged 2 commits into
mainfrom
fix-1nmv-deno-version-order
Nov 4, 2026
Merged

cderv merged 2 commits into
mainfrom
fix-1nmv-deno-version-order

Conversation

@cderv

@cderv cderv commented Nov 4, 2026

Copy link
Copy Markdown
Member

On Windows, the dev launcher package/scripts/windows/quarto.cmd checks that the installed Deno matches the DENO version in configuration, and runs configure.cmd when it doesn't. It recorded the new version in package/dist/config/deno-version before running configure.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.cmd only calls quarto --version, which returns before the check.

Fix

configure.cmd now writes deno-version right after Deno is downloaded and extracted, as configure.sh does, 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.cmd fails, and checks deno-version still holds the previous version. It fails without the fix.

Test plan

  • configure.cmd on a configured checkout writes package/dist/config/deno-version with the pinned version
  • With deno-version set to an older version, package/dist/bin/quarto.cmd --help reconfigures and asks to retry; the retry runs normally

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Claude Code
  • Codebase grounding: local clone
  • Human review: I have reviewed, tested, and verified the AI-generated content before submitting.

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

cderv added 2 commits November 4, 2026 14:06
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.
@posit-snyk-bot

posit-snyk-bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@cderv
cderv merged commit 6e6fc9b into main Nov 4, 2026
52 checks passed
@cderv
cderv deleted the fix-1nmv-deno-version-order branch November 4, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants