ci: LLVM 16 via portable tar.xz (NSIS /S fails silently on unprivileged runner)
Build patched rustdesk.exe / Build Win x64 (Sciter UI) (push) Failing after 21s

This commit is contained in:
2026-05-02 22:15:00 +10:00
parent 2f73725e19
commit 35963eb7a7
+20 -6
View File
@@ -36,18 +36,32 @@ jobs:
& "$env:CARGO_BIN\rustc.exe" --version
& "$env:CARGO_BIN\cargo.exe" --version
- name: Setup LLVM 16 (matches upstream rustdesk CI)
- name: Setup LLVM 16 (portable tar.xz, no admin/UAC)
shell: powershell
run: |
if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) {
$url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$env:LLVM_VERSION/LLVM-$env:LLVM_VERSION-win64.exe"
$dst = "$env:TEMP\llvm-$env:LLVM_VERSION.exe"
# Portable tar.xz instead of NSIS installer — NSIS /S silently
# fails on unprivileged runners (some files missing post-install,
# caught run #4: "LLVM 16 install failed" after Start-Process -Wait
# returned 0). Extract via Windows 10/11 built-in tar.exe.
$url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$env:LLVM_VERSION/clang+llvm-$env:LLVM_VERSION-x86_64-pc-windows-msvc.tar.xz"
$dst = "$env:TEMP\llvm-$env:LLVM_VERSION.tar.xz"
Write-Output "downloading $url"
Invoke-WebRequest -Uri $url -OutFile $dst -UseBasicParsing -TimeoutSec 600
Write-Output "installing to C:\LLVM16"
Start-Process -FilePath $dst -ArgumentList '/S','/D=C:\LLVM16' -Wait
if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) { throw "LLVM 16 install failed" }
$size = (Get-Item $dst).Length
Write-Output "downloaded $([math]::Round($size/1MB,2)) MB; extracting"
New-Item -ItemType Directory -Path 'C:\LLVM16-tmp' -Force | Out-Null
& tar.exe -xf $dst -C 'C:\LLVM16-tmp'
$extracted = Get-ChildItem 'C:\LLVM16-tmp' -Directory | Select-Object -First 1
Move-Item $extracted.FullName 'C:\LLVM16' -Force
Remove-Item 'C:\LLVM16-tmp' -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item $dst -Force -ErrorAction SilentlyContinue
if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) {
Get-ChildItem 'C:\LLVM16' -Recurse -Filter libclang.dll | Select-Object FullName
throw "LLVM 16 extract failed — libclang.dll not found"
}
}
Write-Output "libclang.dll: $((Get-Item 'C:\LLVM16\bin\libclang.dll').Length) bytes"
echo "LIBCLANG_PATH=C:\LLVM16\bin" >> $env:GITHUB_ENV
echo "C:\LLVM16\bin" >> $env:GITHUB_PATH