Skip to content

Commit 5a02c33

Browse files
echobtfactorydroid
andauthored
fix(ci): add LLVM to PATH for Windows ARM64 release builds (#487)
The ring crate requires clang for building on Windows ARM64 targets. Add Visual Studio's bundled LLVM/clang to PATH for the aarch64-pc-windows-msvc target in the release workflow. Reference: https://github.com/briansmith/ring/blob/main/BUILDING.md Co-authored-by: Droid Agent <droid@factory.ai>
1 parent 2ff4e89 commit 5a02c33

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,30 @@ jobs:
161161
prefix-key: "rust-release-cli-${{ matrix.target }}"
162162
shared-key: ${{ needs.prepare.outputs.cache_key }}
163163

164+
# Windows ARM64 requires clang from Visual Studio for building the ring crate
165+
# See: https://github.com/briansmith/ring/blob/main/BUILDING.md
166+
- name: Setup LLVM for Windows ARM64
167+
if: matrix.target == 'aarch64-pc-windows-msvc'
168+
shell: pwsh
169+
run: |
170+
# Add Visual Studio's LLVM to PATH for ring crate compilation
171+
$llvmPath = "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin"
172+
if (Test-Path $llvmPath) {
173+
echo "Adding LLVM path: $llvmPath"
174+
echo "$llvmPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
175+
} else {
176+
# Fallback for BuildTools installation
177+
$llvmPath = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\Llvm\x64\bin"
178+
if (Test-Path $llvmPath) {
179+
echo "Adding LLVM path (BuildTools): $llvmPath"
180+
echo "$llvmPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
181+
} else {
182+
echo "WARNING: LLVM path not found. Build may fail."
183+
echo "Searching for clang..."
184+
Get-ChildItem -Path "C:\Program Files*" -Recurse -Filter "clang.exe" -ErrorAction SilentlyContinue | Select-Object -First 5 | ForEach-Object { echo $_.FullName }
185+
}
186+
}
187+
164188
- name: Build release binary
165189
run: cargo +nightly build --release --target ${{ matrix.target }} -p cortex-cli
166190
env:

0 commit comments

Comments
 (0)