Skip to content

Fix configure failing to extract Pandoc under PowerShell 7.6.10 - #15390

Merged
cderv merged 1 commit into
mainfrom
fix/configure-unzip-breaks-under-pwsh-7-6-10
Nov 17, 2026
Merged

cderv merged 1 commit into
mainfrom
fix/configure-unzip-breaks-under-pwsh-7-6-10

Conversation

@cderv

@cderv cderv commented Nov 17, 2026

Copy link
Copy Markdown
Member

When configure.cmd runs from a PowerShell 7.6.10 terminal on Windows, it stops at "Configuring Pandoc" with NotFound (os error 3) while renaming pandoc.exe. The Pandoc zip downloads correctly, but nothing is extracted from it.

Root cause

The build-time unzip() in package/src/util/utils.ts extracted zips by running Expand-Archive in Windows PowerShell 5.1. The child process inherits PSModulePath from the PowerShell 7 terminal, with PowerShell 7's module folder listed first, so Windows PowerShell 5.1 loads PowerShell 7's Microsoft.PowerShell.Archive module instead of its own.

PowerShell 7.6.10 bundles version 1.2.7 of that module (PowerShell/PowerShell#28410), whose Expand-Archive calls an ExtractToDirectory overload that only exists on .NET Core. Under Windows PowerShell 5.1 the call throws, but the process still exits 0, so configure never showed the error and failed later on the missing file.

Quarto users are not affected. The runtime extraction helper in src/core/zip.ts stopped using Expand-Archive in 33a51a0 and calls [IO.Compression.ZipFile]::ExtractToDirectory directly, which loads no module.

Fix

The build-time unzip() now delegates to the runtime helper in src/core/zip.ts, and throws with the archive path and the error output when extraction fails. This covers every build step that extracts a zip: the Pandoc and Deno binaries, the Pandoc source templates, and the WiX tools for the Windows installer.

Two adjustments come with the delegation. On Linux and macOS the runtime helper runs unzip -o from inside the destination folder, so the folder is now created first. update-pandoc saved the Pandoc source archive without a .zip extension, which the runtime helper would treat as a tarball, so it is now saved as pandoc.zip.

Test plan

CI runners may not have PowerShell 7.6.10, so these were checked locally on Windows with PowerShell 7.6.10:

  • configure.cmd from a PowerShell 7 terminal extracts Pandoc and completes
  • The Deno, Pandoc source and WiX archives extract into the folders their build steps use

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.

On Windows, configure extracted zips by running Expand-Archive in
Windows PowerShell 5.1. When configure is launched from a PowerShell 7
terminal, the child inherits PSModulePath with PowerShell 7's module
directory first, so 5.1 loads PowerShell 7's Microsoft.PowerShell.Archive.
Version 1.2.7 of that module (bundled with PowerShell 7.6.10) calls a
.NET Core-only ExtractToDirectory overload, which throws on .NET
Framework while the process still exits 0. Nothing was extracted, the
error was never printed, and configure later failed renaming
pandoc.exe with "NotFound (os error 3)".

The build-time unzip now delegates to the runtime helper in
src/core/zip.ts, which calls [IO.Compression.ZipFile]::ExtractToDirectory
directly and loads no module (it moved off Expand-Archive in 2023), and
throws with the archive path and stderr when extraction fails.

The runtime helper runs unzip with the destination as cwd on
Linux/macOS, so the destination is created first. update-pandoc
downloaded the pandoc source archive without a .zip extension, which
the runtime helper would treat as a tarball; it now uses pandoc.zip.
@posit-snyk-bot

posit-snyk-bot commented Nov 17, 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 cda4102 into main Nov 17, 2026
52 checks passed
@cderv
cderv deleted the fix/configure-unzip-breaks-under-pwsh-7-6-10 branch November 17, 2026 17:54
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