Skip to content

Commit 20d0390

Browse files
WebKit ARM64 Builderclaude
andcommitted
Make dependency installation architecture-aware
Detect processor architecture and install appropriate versions: - ARM64: Manual LLVM/Ruby installation (Scoop has x64-only versions) - x64: Use Scoop for all dependencies This allows the same workflow to work on both x64 and ARM64 runners. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 7ee7156 commit 20d0390

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,11 @@ jobs:
254254
runs-on: ${{ matrix.runner }}
255255
timeout-minutes: 90
256256
steps:
257-
- name: Install dependencies for ARM64 Windows
257+
- name: Install dependencies for Windows
258258
run: |
259+
# Detect architecture
260+
$isARM64 = $env:PROCESSOR_ARCHITECTURE -eq "ARM64"
261+
259262
# Install Scoop if not available
260263
if (!(Get-Command scoop -ErrorAction SilentlyContinue)) {
261264
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
@@ -264,22 +267,33 @@ jobs:
264267
echo "$env:USERPROFILE\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
265268
}
266269
267-
# Install tools via Scoop (except Ruby and LLVM which need ARM64 versions)
270+
# Install tools via Scoop
268271
scoop install cmake ninja python perl
269272
270-
# Install LLVM ARM64 manually (Scoop downloads x64 on ARM64)
271-
$llvmUrl = "https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.4/LLVM-19.1.4-woa64.exe"
272-
$llvmExe = "$env:TEMP\llvm.exe"
273-
Invoke-WebRequest -Uri $llvmUrl -OutFile $llvmExe
274-
Start-Process -FilePath $llvmExe -ArgumentList "/S", "/D=C:\LLVM" -Wait
275-
echo "C:\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
273+
# Install LLVM - use correct architecture version
274+
if ($isARM64) {
275+
# Scoop installs x64 LLVM on ARM64, need to manually install ARM64 version
276+
$llvmUrl = "https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.4/LLVM-19.1.4-woa64.exe"
277+
$llvmExe = "$env:TEMP\llvm.exe"
278+
Invoke-WebRequest -Uri $llvmUrl -OutFile $llvmExe
279+
Start-Process -FilePath $llvmExe -ArgumentList "/S", "/D=C:\LLVM" -Wait
280+
echo "C:\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
281+
} else {
282+
# x64 can use Scoop's LLVM
283+
scoop install llvm
284+
}
276285
277-
# Install Ruby manually since Scoop's Ruby fails on ARM64
278-
$rubyUrl = "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.3.6-1/rubyinstaller-devkit-3.3.6-1-x64.exe"
279-
$rubyExe = "$env:TEMP\ruby.exe"
280-
Invoke-WebRequest -Uri $rubyUrl -OutFile $rubyExe
281-
Start-Process -FilePath $rubyExe -ArgumentList "/VERYSILENT", "/NORESTART", "/DIR=C:\Ruby33-x64" -Wait
282-
echo "C:\Ruby33-x64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
286+
# Install Ruby manually on ARM64 (Scoop's Ruby fails on ARM64)
287+
if ($isARM64) {
288+
$rubyUrl = "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.3.6-1/rubyinstaller-devkit-3.3.6-1-x64.exe"
289+
$rubyExe = "$env:TEMP\ruby.exe"
290+
Invoke-WebRequest -Uri $rubyUrl -OutFile $rubyExe
291+
Start-Process -FilePath $rubyExe -ArgumentList "/VERYSILENT", "/NORESTART", "/DIR=C:\Ruby33-x64" -Wait
292+
echo "C:\Ruby33-x64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
293+
} else {
294+
# x64 can use Scoop's Ruby
295+
scoop install ruby
296+
}
283297
284298
# Install vcpkg
285299
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg

0 commit comments

Comments
 (0)