Skip to content

Commit 33e90b7

Browse files
committed
fix(ci): Work around unset VCToolsRedistDir environment variable
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
1 parent bb5301a commit 33e90b7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/windows.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ jobs:
135135
136136
# Include MSVC 2019 runtime libraries.
137137
if ('${{ matrix.build-type }}' -ieq 'release') {
138+
if ($env:VCToolsRedistDir -eq $null) {
139+
# XXX: Hack to work around this issue: https://github.com/actions/runner-images/issues/10819
140+
$env:VCToolsRedistDir = -join ($env:VCINSTALLDIR, "Redist\MSVC\", $env:VCToolsVersion, "\")
141+
}
138142
Copy-Item $env:VCToolsRedistDir\${{ matrix.arch }}\Microsoft.VC142.CRT\msvcp140.dll
139143
Copy-Item $env:VCToolsRedistDir\${{ matrix.arch }}\Microsoft.VC142.CRT\msvcp140_1.dll
140144

0 commit comments

Comments
 (0)