From 4d46a35d7f1d1f129e81cdd791ce9e9d325a1c77 Mon Sep 17 00:00:00 2001 From: Pasha Stetsenko Date: Thu, 16 Nov 2023 13:19:01 -0800 Subject: [PATCH] try more paths --- .github/workflows/build-and-test-windows.yml | 14 +++++++------- ci/xbuild/compiler.py | 10 +++++++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-test-windows.yml b/.github/workflows/build-and-test-windows.yml index db211127e..d06a811b0 100644 --- a/.github/workflows/build-and-test-windows.yml +++ b/.github/workflows/build-and-test-windows.yml @@ -14,7 +14,7 @@ jobs: runs-on: windows-latest env: - DT_HARNESS: 'GitHub' + DT_HARNESS: GitHub DT_BUILD_ID: ${{ github.run_id }} DT_BUILD_NUMBER: '' DT_BUILD_SUFFIX: '' @@ -30,19 +30,19 @@ jobs: - name: Prepare environment variables run: | - $env:DT_BUILD_ID = (git rev-list --count origin/main) - 1 + echo "DT_BUILD_ID=$((git rev-list --count origin/main) - 1)" >> $env:DT_BUILD_ID if ($env:GITHUB_EVENT_NAME -eq 'pull_request') { if ($env:GITHUB_PULL_REQUEST_HEAD_REPO_BRANCH -match '^rel-') { - $env:DT_RELEASE = 'True' + echo "DT_RELEASE=True" >> $env:DT_RELEASE } else { - $env:DT_BUILD_SUFFIX = "PR$($env:GITHUB_EVENT_NUMBER).$DT_BUILD_ID" + echo "DT_BUILD_SUFFIX=PR$($env:GITHUB_EVENT_NUMBER).$env:DT_BUILD_ID" >> $env:DT_BUILD_SUFFIX } } elseif ($env:GITHUB_REF -eq 'refs/heads/main') { - $env:DT_BUILD_NUMBER = $DT_BUILD_ID + echo "DT_BUILD_NUMBER=$env:DT_BUILD_ID" >> $env:DT_BUILD_NUMBER } elseif ($env:GITHUB_REF -match '^refs/heads/rel-') { - $env:DT_RELEASE = 'True' + echo "DT_RELEASE=True" >> $env:DT_RELEASE } else { - $env:DT_BUILD_SUFFIX = "$($env:GITHUB_REF).$DT_BUILD_ID" + echo "DT_BUILD_SUFFIX=$env:GITHUB_REF.$env:DT_BUILD_ID" >> $env:DT_BUILD_SUFFIX } - name: Print environment diff --git a/ci/xbuild/compiler.py b/ci/xbuild/compiler.py index ab7eefb00..5630e7450 100644 --- a/ci/xbuild/compiler.py +++ b/ci/xbuild/compiler.py @@ -150,10 +150,14 @@ def _detect_compiler_executable(self): f"Directory DT_MSVC_PATH=`{msvc_path}` does not exist." ) else: - path0 = pathlib.Path( - "C:\\Program Files (x86)\\Microsoft Visual Studio" - ) while True: + path0 = pathlib.Path( + "C:\\Program Files (x86)\\Microsoft Visual Studio" + ) + if not path0.is_dir(): + path0 = pathlib.Path( + "C:\\Program Files\\Microsoft Visual Studio" + ) if not path0.is_dir(): break subdirs = [ subpath for subpath in path0.iterdir()