From f29d57799f77a97c0d4b9f58acb659b0012877f8 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 18 Aug 2025 03:48:03 +0200 Subject: [PATCH] cleanups --- .github/workflows/windows.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9a094ad281..f854220573 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -840,22 +840,19 @@ jobs: else # Use Ninja when running tests to avoid MSBuild heuristics picking # up "error messages" in the test log output and making the job fail. - # Unfortunately switching CPU target requires vcvarsall.bat, which - # has no stable disk location, its an MS-DOS batch file setting env, - # and makes it problematic to use from this script. + # Officially this requires the vcvarsall.bat MS-DOS batch file (as of + # VS2022). Since it integrates badly with CI steps and shell scripts + # scripts, reproduce the necessary build configuration manually, and + # without envs. [[ "$(uname -s)" = *'ARM64'* ]] && MSVC_HOST='arm64' || MSVC_HOST='x64' # x86 MSVC_ROOTD="$(cygpath --mixed --short-name "$PROGRAMFILES/Microsoft Visual Studio")" # to avoid spaces in directory names MSVC_ROOTU="$(/usr/bin/find "$(cygpath --unix "$MSVC_ROOTD/2022/Enterprise/vc/tools/msvc")" -mindepth 1 -maxdepth 1 -type d -name '*.*' | sort | tail -n 1)" MSVC_ROOTW="$(cygpath --mixed "$MSVC_ROOTU")" MSVC_ROOTU="$(cygpath --unix "$MSVC_ROOTW")" - echo "MSVC_ROOTW:|$MSVC_ROOTW|" - echo "MSVC_ROOTU:|$MSVC_ROOTU|" MSVC_BINU="$MSVC_ROOTU/bin/Host$MSVC_HOST/$MATRIX_ARCH" - echo "MSVC_BINU:|$MSVC_BINU|" MSDK_ROOTW="$(cygpath --mixed --short-name "$(printenv 'ProgramFiles(x86)')/Windows Kits")/10" MSDK_ROOTU="$(cygpath --unix "$MSDK_ROOTW")" MSDK_VER="$(basename "$(/usr/bin/find "$MSDK_ROOTU/lib" -mindepth 1 -maxdepth 1 -type d -name '*.*' | sort | tail -n 1)")" - echo "MSDK_VER:|$MSDK_VER|" MSDK_LIBW="$MSDK_ROOTW/lib/$MSDK_VER" MSDK_INCW="$MSDK_ROOTW/include/$MSDK_VER" MSDK_BINU="$MSDK_ROOTU/bin/$MSDK_VER/$MSVC_HOST" @@ -874,7 +871,7 @@ jobs: options+=" -DCMAKE_C_COMPILER=$MSVC_BINU/cl.exe" rcflags+=" -I$MSDK_INCW/shared" rcflags+=" -I$MSDK_INCW/um" - export CMAKE_GENERATOR='Ninja Multi-Config' + export CMAKE_GENERATOR='Ninja Multi-Config' # pass it via env to avoid space issues fi [ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF' if [ -n "${MATRIX_INSTALL_VCPKG}" ]; then