fix(release): select clang for Windows ARM64 builds (#13052)

* fix(release): select clang for Windows ARM64 builds

* fix(release): wait for clang installation
This commit is contained in:
Zoltan Kochan
2026-07-15 23:33:00 +02:00
committed by GitHub
parent cfe58bf52f
commit 49cd3e015f

View File

@@ -375,6 +375,23 @@ jobs:
$installPath = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe" modify --installPath "$installPath" --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --quiet --norestart
if ($LASTEXITCODE -ne 0) { throw "Visual Studio installer exited with $LASTEXITCODE" }
$llvmDir = Join-Path $installPath 'VC\Tools\Llvm'
$deadline = (Get-Date).AddMinutes(5)
$installerRunning = $true
$clangCl = $null
do {
$installerRunning = @(Get-Process -Name 'vs_installer', 'vs_setup', 'setup' -ErrorAction SilentlyContinue).Count -gt 0
$clangCl = @(
(Join-Path $llvmDir 'ARM64\bin\clang-cl.exe'),
(Join-Path $llvmDir 'x64\bin\clang-cl.exe')
) | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1
if ($installerRunning -or $null -eq $clangCl) { Start-Sleep -Seconds 5 }
} while (($installerRunning -or $null -eq $clangCl) -and (Get-Date) -lt $deadline)
if ($installerRunning) { throw 'Visual Studio installer did not finish within five minutes' }
if ($null -eq $clangCl) { throw "clang-cl was not installed under $llvmDir" }
& $clangCl --version
"CC_aarch64_pc_windows_msvc=$clangCl" >> $env:GITHUB_ENV
"CXX_aarch64_pc_windows_msvc=$clangCl" >> $env:GITHUB_ENV
# No build cache: GitHub Actions caches are writable by any workflow on
# the default branch, so restoring one here would let a poisoned cache
@@ -749,6 +766,23 @@ jobs:
$installPath = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\setup.exe" modify --installPath "$installPath" --add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --quiet --norestart
if ($LASTEXITCODE -ne 0) { throw "Visual Studio installer exited with $LASTEXITCODE" }
$llvmDir = Join-Path $installPath 'VC\Tools\Llvm'
$deadline = (Get-Date).AddMinutes(5)
$installerRunning = $true
$clangCl = $null
do {
$installerRunning = @(Get-Process -Name 'vs_installer', 'vs_setup', 'setup' -ErrorAction SilentlyContinue).Count -gt 0
$clangCl = @(
(Join-Path $llvmDir 'ARM64\bin\clang-cl.exe'),
(Join-Path $llvmDir 'x64\bin\clang-cl.exe')
) | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1
if ($installerRunning -or $null -eq $clangCl) { Start-Sleep -Seconds 5 }
} while (($installerRunning -or $null -eq $clangCl) -and (Get-Date) -lt $deadline)
if ($installerRunning) { throw 'Visual Studio installer did not finish within five minutes' }
if ($null -eq $clangCl) { throw "clang-cl was not installed under $llvmDir" }
& $clangCl --version
"CC_aarch64_pc_windows_msvc=$clangCl" >> $env:GITHUB_ENV
"CXX_aarch64_pc_windows_msvc=$clangCl" >> $env:GITHUB_ENV
# No build cache: GitHub Actions caches are writable by any workflow on
# the default branch, so restoring one here would let a poisoned cache