Prefer lld-link in MSVC setup action

This commit is contained in:
starr-openai
2026-05-13 16:47:23 -07:00
parent 04132fdfbf
commit 96b02724a0

View File

@@ -93,10 +93,14 @@ runs:
throw "VCToolsInstallDir was not exported by VsDevCmd.bat"
}
$linker = Join-Path $vcToolsInstallDir "bin\Host${hostArch}\${targetArch}\link.exe"
$linker = Join-Path $installPath "VC\Tools\Llvm\x64\bin\lld-link.exe"
if (-not (Test-Path $linker)) {
throw "MSVC linker not found at $linker"
$linker = Join-Path $vcToolsInstallDir "bin\Host${hostArch}\${targetArch}\link.exe"
}
if (-not (Test-Path $linker)) {
throw "Windows linker not found at $linker"
}
Write-Output "Using Windows linker: $linker"
$cargoTarget = "${{ inputs.target }}".ToUpperInvariant().Replace("-", "_")
"CARGO_TARGET_${cargoTarget}_LINKER=$linker" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append