authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-02 16:46:37-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-02 16:46:37-07:00
log4ba39a6f408bdee468df2e3ffdf7d5dc08e7b59d
tree0c4ae3193e8cfb7d94495f38ff53805f2d1aef67
parent994bd7373cf3a335c204a617604e690ed4c00cba
signature Signed by PGP key B5690EEEBB952194

fix(desktop): detect installed Spectre libs for Windows builds

Replace the obsolete Visual Studio Spectre component check with an architecture-specific filesystem check against the latest installed MSVC toolset. This lets current Visual Studio Build Tools installs pass Windows desktop preflight while still failing when the required Spectre libraries are absent. Model: GPT-5 Codex via T3 Code.

1 files changed, 8 insertions(+), 10 deletions(-)

scripts/build-desktop-artifact.ts+8-10
......@@ -1707,23 +1707,21 @@ export const preflightMacDesktopBuild = Effect.fn("preflightMacDesktopBuild")(fu
17071707});
17081708
17091709function windowsVswherePrerequisiteScript(arch: typeof BuildArch.Type): string {
1710 const components =
1710 const toolComponents =
17111711 arch === "arm64"
1712 ? [
1713 "Microsoft.VisualStudio.Component.VC.Tools.ARM64",
1714 "Microsoft.VisualStudio.Component.VC.Tools.ARM64.Spectre",
1715 ]
1716 : [
1717 "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
1718 "Microsoft.VisualStudio.Component.VC.Tools.x86.x64.Spectre",
1719 ];
1712 ? ["Microsoft.VisualStudio.Component.VC.Tools.ARM64"]
1713 : ["Microsoft.VisualStudio.Component.VC.Tools.x86.x64"];
1714 const spectreArch = arch === "arm64" ? "arm64" : "x64";
17201715 return [
17211716 "$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\\Installer\\vswhere.exe'",
17221717 "if (!(Test-Path $vswhere)) { exit 1 }",
1723 `$install = & $vswhere -latest -products * -requires ${components.join(" ")} -property installationPath`,
1718 `$install = & $vswhere -latest -products * -requires ${toolComponents.join(" ")} -property installationPath`,
17241719 "if (!$install) { exit 1 }",
17251720 "$kitsRoot = Get-ItemPropertyValue 'HKLM:\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots' -Name KitsRoot10 -ErrorAction SilentlyContinue",
17261721 "if (!$kitsRoot -or !(Test-Path (Join-Path $kitsRoot 'Lib'))) { exit 1 }",
1722 "$msvcToolset = Get-ChildItem (Join-Path $install 'VC\\Tools\\MSVC') -Directory | Sort-Object { [version]$_.Name } -Descending | Select-Object -First 1",
1723 "if (!$msvcToolset) { exit 1 }",
1724 `if (!(Test-Path (Join-Path $msvcToolset.FullName 'lib\\spectre\\${spectreArch}'))) { exit 1 }`,
17271725 ].join("; ");
17281726}
17291727