From 33e90b788c80fe7d1f21a6cb183dd3ac9415b2a5 Mon Sep 17 00:00:00 2001 From: guihkx <626206+guihkx@users.noreply.github.com> Date: Sat, 19 Oct 2024 11:55:44 -0300 Subject: [PATCH] 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] https://github.com/actions/runner-images/issues/10819 --- .github/workflows/windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1c62af6d..c1446d04 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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