From ee71e3086567e7036249550d2885d2256993423f Mon Sep 17 00:00:00 2001 From: Pasha Stetsenko Date: Thu, 16 Nov 2023 12:12:38 -0800 Subject: [PATCH] add extra msvc path candidate --- .github/workflows/build-and-test-windows.yml | 13 +++++++++---- ci/xbuild/compiler.py | 6 ++++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test-windows.yml b/.github/workflows/build-and-test-windows.yml index 304f24e8e9..9bad4030b9 100644 --- a/.github/workflows/build-and-test-windows.yml +++ b/.github/workflows/build-and-test-windows.yml @@ -42,10 +42,15 @@ jobs: - name: Print environment run: | - echo "DT_BUILD_ID = $DT_BUILD_ID" - echo "DT_RELEASE = $DT_RELEASE" - echo "DT_BUILD_SUFFIX = $DT_BUILD_SUFFIX" - echo "DT_BUILD_NUMBER = $DT_BUILD_NUMBER" + echo "GITHUB_EVENT_NAME = $env:GITHUB_EVENT_NAME" + echo "GITHUB_EVENT_NUMBER = $env:GITHUB_EVENT_NUMBER" + echo "GITHUB_REF = $env:GITHUB_REF" + echo "GITHUB_EVENT_PULL_REQUEST_HEAD_REF = $env:GITHUB_EVENT_PULL_REQUEST_HEAD_REF" + echo "DT_HARNESS = $env:DT_HARNESS" + echo "DT_BUILD_ID = $env:DT_BUILD_ID" + echo "DT_RELEASE = $env:DT_RELEASE" + echo "DT_BUILD_SUFFIX = $env:DT_BUILD_SUFFIX" + echo "DT_BUILD_NUMBER = $env:DT_BUILD_NUMBER" - name: Set up Python 3.8 uses: actions/setup-python@v3 diff --git a/ci/xbuild/compiler.py b/ci/xbuild/compiler.py index 698b4e7b8b..b6bf3ff489 100644 --- a/ci/xbuild/compiler.py +++ b/ci/xbuild/compiler.py @@ -144,8 +144,10 @@ def _detect_compiler_executable(self): if sys.platform == "win32": self._detect_winsdk() - msvc_default_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\" - msvc_path = os.environ.get("DT_MSVC_PATH", msvc_default_path) + msvc_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\" + if not os.path.isdir(msvc_path): + msvc_path = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC" + msvc_path = os.environ.get("DT_MSVC_PATH", msvc_path) if not os.path.isdir(msvc_path): raise ValueError("Microsoft Visual Studio directory %s not found. " "Please specify its location in `DT_MSVC_PATH` environment variable."