ci: simplify LLVM 16 step to use pre-staged C:\LLVM16 (NSIS demands UAC; no Windows tar.xz exists)
Build patched rustdesk.exe / Build Win x64 (Sciter UI) (push) Failing after 34s

This commit is contained in:
2026-05-02 23:04:21 +10:00
parent 9f8aadd01c
commit f479c64c3d
+11 -26
View File
@@ -36,36 +36,21 @@ jobs:
& "$env:CARGO_BIN\rustc.exe" --version & "$env:CARGO_BIN\rustc.exe" --version
& "$env:CARGO_BIN\cargo.exe" --version & "$env:CARGO_BIN\cargo.exe" --version
- name: Setup LLVM 16 (portable tar.xz, no admin/UAC) - name: Setup LLVM 16 (pre-staged on runner host)
shell: powershell shell: powershell
run: | run: |
# LLVM 16.0.0 is pre-staged at C:\LLVM16 on yowie-admin-pc.
# Bootstrap path documented in feedback memory file (extracted
# from LLVM-16.0.0-win64.exe NSIS installer via choco's 7z.exe).
# Re-running NSIS install on every CI run was infeasible: the
# LLVM win64.exe demands UAC elevation even with /S, and there
# is no Windows tar.xz asset for LLVM 16 (only NSIS).
if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) { if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) {
# Portable tar.xz instead of NSIS installer -- NSIS /S silently throw "LLVM 16 not pre-staged on runner; expected C:\LLVM16\bin\libclang.dll. Re-run runner-bootstrap script."
# 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"
# curl.exe (Win10+ bundled) uses Schannel -- avoids PS5.1 TLS 1.0
# default that GitHub now rejects (caught run #7: connection
# closed unexpectedly within 500ms).
& curl.exe -L --fail --retry 3 --retry-delay 5 --max-time 900 -o $dst $url
if ($LASTEXITCODE -ne 0) { throw "curl failed downloading LLVM tar.xz (exit $LASTEXITCODE)" }
$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" $sz = (Get-Item 'C:\LLVM16\bin\libclang.dll').Length
Write-Output "libclang.dll: $([math]::Round($sz/1MB,2)) MB"
& 'C:\LLVM16\bin\clang.exe' --version | Select-Object -First 1
echo "LIBCLANG_PATH=C:\LLVM16\bin" >> $env:GITHUB_ENV echo "LIBCLANG_PATH=C:\LLVM16\bin" >> $env:GITHUB_ENV
echo "C:\LLVM16\bin" >> $env:GITHUB_PATH echo "C:\LLVM16\bin" >> $env:GITHUB_PATH