From 4ba39a6f408bdee468df2e3ffdf7d5dc08e7b59d Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 2 Sep 2026 16:46:37 -0700 Subject: [PATCH] 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. --- scripts/build-desktop-artifact.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/build-desktop-artifact.ts b/scripts/build-desktop-artifact.ts index 17c038979d0eae69bc9b8aa23e85bd3f18db5c87..f4bbad9d5407935b585c0caffa9a64fea64ec9fc 100644 --- a/scripts/build-desktop-artifact.ts +++ b/scripts/build-desktop-artifact.ts @@ -1707,23 +1707,21 @@ export const preflightMacDesktopBuild = Effect.fn("preflightMacDesktopBuild")(fu }); function windowsVswherePrerequisiteScript(arch: typeof BuildArch.Type): string { - const components = + const toolComponents = arch === "arm64" - ? [ - "Microsoft.VisualStudio.Component.VC.Tools.ARM64", - "Microsoft.VisualStudio.Component.VC.Tools.ARM64.Spectre", - ] - : [ - "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", - "Microsoft.VisualStudio.Component.VC.Tools.x86.x64.Spectre", - ]; + ? ["Microsoft.VisualStudio.Component.VC.Tools.ARM64"] + : ["Microsoft.VisualStudio.Component.VC.Tools.x86.x64"]; + const spectreArch = arch === "arm64" ? "arm64" : "x64"; return [ "$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\\Installer\\vswhere.exe'", "if (!(Test-Path $vswhere)) { exit 1 }", - `$install = & $vswhere -latest -products * -requires ${components.join(" ")} -property installationPath`, + `$install = & $vswhere -latest -products * -requires ${toolComponents.join(" ")} -property installationPath`, "if (!$install) { exit 1 }", "$kitsRoot = Get-ItemPropertyValue 'HKLM:\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots' -Name KitsRoot10 -ErrorAction SilentlyContinue", "if (!$kitsRoot -or !(Test-Path (Join-Path $kitsRoot 'Lib'))) { exit 1 }", + "$msvcToolset = Get-ChildItem (Join-Path $install 'VC\\Tools\\MSVC') -Directory | Sort-Object { [version]$_.Name } -Descending | Select-Object -First 1", + "if (!$msvcToolset) { exit 1 }", + `if (!(Test-Path (Join-Path $msvcToolset.FullName 'lib\\spectre\\${spectreArch}'))) { exit 1 }`, ].join("; "); } -- 2.54.0