Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions .github/actions/setup-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,31 @@ runs:
git config --system core.longpaths true
[System.IO.File]::WriteAllLines((Join-Path -Path $env:USERPROFILE -ChildPath '.bazelrc'), 'startup --output_user_root=\\\\?\\C:\\tmp')
# Use LLVM 22 to work around https://github.com/actions/runner-images/issues/15367 - the
# runner defaults to LLVM 20 which is incompatible with latest MSVC
choco upgrade llvm --version=22.1.8
# runner defaults to LLVM 20 which is incompatible with latest MSVC.
# choco exits 0 when its feed is unreachable, so check the installed version, and install
# from the LLVM GitHub release when the feed is down.
$llvmVersion = '22.1.8'
$llvmInstallerSha256 = '16e5709785fef73c854646241c4a92c5cd574318d1b33c63330dd7721903e55c'
$clangCl = 'C:\Program Files\LLVM\bin\clang-cl.exe'
function Test-Llvm {
(& $clangCl --version | Out-String) -match "clang version $([regex]::Escape($llvmVersion))"
}
choco upgrade llvm --version=$llvmVersion -y --no-progress
if (-not (Test-Llvm)) {
Write-Output "choco did not install LLVM $llvmVersion, installing it from the LLVM GitHub release"
$installer = Join-Path $env:RUNNER_TEMP "LLVM-$llvmVersion-win64.exe"
Invoke-WebRequest -Uri "https://github.com/llvm/llvm-project/releases/download/llvmorg-$llvmVersion/LLVM-$llvmVersion-win64.exe" `
-OutFile $installer -MaximumRetryCount 3 -RetryIntervalSec 10
if ((Get-FileHash -Algorithm SHA256 $installer).Hash -ne $llvmInstallerSha256) {
Write-Error "LLVM-$llvmVersion-win64.exe does not match its SHA-256"
exit 1
}
Start-Process -FilePath $installer -ArgumentList '/S' -Wait
}
if (-not (Test-Llvm)) {
Write-Error "Failed to install LLVM $llvmVersion; refusing to build with $(& $clangCl --version | Select-Object -First 1)"
exit 1
}
- name: Configure git hooks
shell: bash
# Configure git to quell an irrelevant warning for runners (they never commit / push).
Expand Down
Loading