Skip to content

Commit 47a9f65

Browse files
committed
fix: scan vcpkg output for actual libxml2 .lib filename
vcpkg names it libxml2.lib, not libxml2s.lib. Scan candidates and copy whichever is found as libxml2s.lib into the LLVM prefix.
1 parent 01da39d commit 47a9f65

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,18 +127,22 @@ jobs:
127127
# into the LLVM prefix lib dir so the linker finds it without
128128
# a global LIB override (which previously caused duplicate symbols).
129129
vcpkg install libxml2:x64-windows-static
130-
$src = "$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows-static\lib\libxml2s.lib"
130+
$vcpkgLib = "$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows-static\lib"
131131
$dest = "$env:USERPROFILE\llvm\lib\libxml2s.lib"
132-
if (-not (Test-Path $src)) {
133-
# Fallback: try the non-static triplet
134-
$src = "$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib\libxml2s.lib"
132+
# vcpkg names it libxml2.lib; LLVM expects libxml2s.lib
133+
$candidates = @("$vcpkgLib\libxml2s.lib", "$vcpkgLib\libxml2.lib", "$vcpkgLib\xml2s.lib", "$vcpkgLib\xml2.lib")
134+
Write-Host "Scanning for libxml2 in $vcpkgLib ..."
135+
Get-ChildItem $vcpkgLib -Filter "*xml2*" | ForEach-Object { Write-Host " found: $($_.FullName)" }
136+
$src = $null
137+
foreach ($c in $candidates) {
138+
if (Test-Path $c) { $src = $c; break }
135139
}
136-
if (-not (Test-Path $src)) {
137-
Write-Error "libxml2s.lib not found after vcpkg install"
140+
if (-not $src) {
141+
Write-Error "No libxml2 .lib found in $vcpkgLib"
138142
exit 1
139143
}
140144
Copy-Item $src $dest -Force
141-
Write-Host "Copied libxml2s.lib to $dest"
145+
Write-Host "Copied $src -> $dest"
142146
143147
# ── Rust Toolchain ────────────────────────────────────────────
144148

0 commit comments

Comments
 (0)