Skip to content

Commit

Permalink
fix(ci): Work around unset VCToolsRedistDir environment variable
Browse files Browse the repository at this point in the history
Recently, the "vcvarsall.bat" batch script from VS 2019 has stopped
defining the VCToolsRedistDir environment variable, for reasons unknown
so far [1].

We rely on that variable in CI to copy MSVC runtime DLLs to our Windows
packages, so this adds a workaround for when that variable is not set.

[1] actions/runner-images#10819
  • Loading branch information
guihkx committed Oct 20, 2024
1 parent bb5301a commit 33e90b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ jobs:
# Include MSVC 2019 runtime libraries.
if ('${{ matrix.build-type }}' -ieq 'release') {
if ($env:VCToolsRedistDir -eq $null) {
# XXX: Hack to work around this issue: https://github.com/actions/runner-images/issues/10819
$env:VCToolsRedistDir = -join ($env:VCINSTALLDIR, "Redist\MSVC\", $env:VCToolsVersion, "\")
}
Copy-Item $env:VCToolsRedistDir\${{ matrix.arch }}\Microsoft.VC142.CRT\msvcp140.dll
Copy-Item $env:VCToolsRedistDir\${{ matrix.arch }}\Microsoft.VC142.CRT\msvcp140_1.dll
Expand Down

0 comments on commit 33e90b7

Please sign in to comment.