Repository navigation
DEV-8216: fix Windows MSI build — extract Node runtime via .NET ZipFile - #93
ariel-greenfeld wants to merge 2 commits into
Conversation
…Archive (cherry picked from commit 600202a)
xyte-genie
left a comment
There was a problem hiding this comment.
AI: The Windows installer build has been failing on main and on every pull request because the step that unpacks the bundled Node runtime silently reported success while doing nothing. This change unpacks the runtime through a built-in Windows library instead, and makes a failed unpack stop the build with a clear error. It is split out as its own change so it can land before the v0.17.0 release, which otherwise would ship without Windows installer assets.
reviewed@d0c90e4d9c75f92914250e4358b23e3c9423703a
| mkdirSync(extractDir, { recursive: true }); | ||
|
|
||
| if (process.platform === 'win32') { | ||
| // Call .NET directly: Expand-Archive in powershell.exe launched from a pwsh 7 step loads |
There was a problem hiding this comment.
AI: [Decision] Windows PowerShell launched from a pwsh 7 CI step: work around the module-path clash at this one call, not in the step
- Situation: Every Windows PowerShell 5.1 child of a pwsh 7 CI step inherits pwsh's module path; a shared-name module then loads the wrong edition, fails, and can still exit 0.
- Chosen: Only the Node runtime extract stops using the clashing cmdlet and calls .NET directly; the inherited environment stays as it is for the other 5.1 children in CI.
- Alternative: Fix it once at the boundary: clear or reset the module path in the build step, or run the MSI build from a non-pwsh shell, so no 5.1 child inherits it.
- Impact: Accepted risk: any future or sibling 5.1 call in CI that uses a module both editions ship can silently fail the same way; today's other callers use none.
- Decided by: reviewer bot (inferred)
There was a problem hiding this comment.
AI: Acknowledged — this is a release-blocking fix for the v0.17.0 tag, so it stays at the one failing call; the other powershell.exe callers use no module that both editions ship. A step-level PSModulePath reset is a reasonable follow-up if more 5.1 calls are added.
|
AI: Review lenses for d0c90e4
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linear: DEV-8216
What
windows-installer-packageis red onmainand on every PR.scripts/package_windows_msi.mjsextracted the Node.js Windows zip withpowershell.exe -Command Expand-Archive. The CI step runs under pwsh 7, so Windows PowerShell 5.1 inherits pwsh 7'sPSModulePath, loads pwsh 7's Archive module and fails withCannot find an overload for "ExtractToDirectory" and the argument count: "3". powershell.exe still exits 0, and the build then dies onENOENT … node.exe.This PR cherry-picks Boris's fix from #90 (600202a): extract with
[System.IO.Compression.ZipFile]::ExtractToDirectoryunder$ErrorActionPreference = 'Stop', so a failed extract now fails the extract step. It is a separate PR so it can land before the v0.17.0 tag; #90 conflicts withmain.Release impact
publish.yml) does not run this script and is not affected.release-assets.yml→windows-msiruns this script on the tag checkout. Without this fix in the tagged commit, the release gets no MSI / WinGet assets, and aforce_windows_msire-run cannot fix it. Order: merge this → updaterelease-0.17.0(Release 0.17.0 #92) frommain→ tag.Tests
windows-installer-packagejob (build, install, PATH and PS 5.1 smoke) — the only place the win32 path runs. The same change was green on DEV-8096: GET organization device details history (hub #9871) #90 (run 45209970966).node --check scripts/package_windows_msi.mjs,npx vitest run tests/windows-packaging.test.ts(8/8).Decided for you
ZipFilein powershell.exe — instead oftar.exe/pwsh/ resettingPSModulePath(unproven on the runner, tag is tomorrow).securityjob left alone — green onmainnow, 0 high advisories onmain's lockfile.🤖 Generated with Claude Code