From f479c64c3d53a8e51a92e5a57b94a0e3b6bb3c09 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 2 May 2026 23:04:21 +1000 Subject: [PATCH] ci: simplify LLVM 16 step to use pre-staged C:\LLVM16 (NSIS demands UAC; no Windows tar.xz exists) --- .gitea/workflows/build.yml | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index d40233279..cbb1b2092 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -36,36 +36,21 @@ jobs: & "$env:CARGO_BIN\rustc.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 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')) { - # 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" - # 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" - } + throw "LLVM 16 not pre-staged on runner; expected C:\LLVM16\bin\libclang.dll. Re-run runner-bootstrap script." } - 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 "C:\LLVM16\bin" >> $env:GITHUB_PATH