From 6beefc2f394c561d4fc76bd140f4e455cf951ba0 Mon Sep 17 00:00:00 2001 From: "blacksmith-sh[bot]" <157653362+blacksmith-sh[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 09:31:18 +0000 Subject: [PATCH 1/3] Migrate workflows to Blacksmith --- .github/workflows/msbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index ae8f0e3..48ce1d7 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -17,7 +17,7 @@ permissions: jobs: build: - runs-on: windows-latest + runs-on: blacksmith-4vcpu-windows-2025 strategy: matrix: platform: [arm64, x64] From 2a0c98737a9f16f32599191424cfa7f49f051cfa Mon Sep 17 00:00:00 2001 From: vineelsai26 Date: Tue, 5 May 2026 09:33:09 +0000 Subject: [PATCH 2/3] build: support VS Build Tools install on Windows runners Co-authored-by: Codesmith --- build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.py b/build.py index 3f05835..5da2191 100644 --- a/build.py +++ b/build.py @@ -4,7 +4,7 @@ PROGRAM_FILES = os.environ["ProgramFiles"] VISUAL_STUDIO_INSTALLED_VERSION = 2022 -VISUAL_STUDIO_INSTALLED_VARIANT = ["Community", "Professional", "Enterprise"] +VISUAL_STUDIO_INSTALLED_VARIANT = ["Community", "Professional", "Enterprise", "BuildTools"] MS_BUILD_PATH = '{}\\Microsoft Visual Studio\\{}\\{}\\MSBuild\\Current\\Bin\\MSBuild.exe' From bec2b779d085bb1392c3489f3c30ed381045ef2e Mon Sep 17 00:00:00 2001 From: vineelsai26 Date: Tue, 5 May 2026 09:34:30 +0000 Subject: [PATCH 3/3] build: locate VS Build Tools under Program Files (x86) on Windows runners Co-authored-by: Codesmith --- build.py | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/build.py b/build.py index 5da2191..f9bc9d9 100644 --- a/build.py +++ b/build.py @@ -2,22 +2,32 @@ import sys import shutil -PROGRAM_FILES = os.environ["ProgramFiles"] -VISUAL_STUDIO_INSTALLED_VERSION = 2022 -VISUAL_STUDIO_INSTALLED_VARIANT = ["Community", "Professional", "Enterprise", "BuildTools"] - -MS_BUILD_PATH = '{}\\Microsoft Visual Studio\\{}\\{}\\MSBuild\\Current\\Bin\\MSBuild.exe' - -for variant in VISUAL_STUDIO_INSTALLED_VARIANT: - if os.path.exists( - MS_BUILD_PATH.format( - PROGRAM_FILES, VISUAL_STUDIO_INSTALLED_VERSION, variant - ) - ): - MS_BUILD_PATH = MS_BUILD_PATH.format( - PROGRAM_FILES, VISUAL_STUDIO_INSTALLED_VERSION, variant - ) - break +PROGRAM_FILES_DIRS = [ + d for d in ( + os.environ.get("ProgramFiles"), + os.environ.get("ProgramFiles(x86)"), + ) if d +] +VISUAL_STUDIO_INSTALLED_VERSION = 2022 +VISUAL_STUDIO_INSTALLED_VARIANT = ["Community", "Professional", "Enterprise", "BuildTools"] + +MS_BUILD_PATH_TEMPLATE = '{}\\Microsoft Visual Studio\\{}\\{}\\MSBuild\\Current\\Bin\\MSBuild.exe' +MS_BUILD_PATH = None + +for program_files in PROGRAM_FILES_DIRS: + for variant in VISUAL_STUDIO_INSTALLED_VARIANT: + candidate = MS_BUILD_PATH_TEMPLATE.format( + program_files, VISUAL_STUDIO_INSTALLED_VERSION, variant + ) + if os.path.exists(candidate): + MS_BUILD_PATH = candidate + break + if MS_BUILD_PATH: + break + +if not MS_BUILD_PATH: + # Fall back to MSBuild on PATH (e.g. added by microsoft/setup-msbuild). + MS_BUILD_PATH = shutil.which("MSBuild") or shutil.which("MSBuild.exe") or "MSBuild.exe" PROJECT_SOLUTION_PATH = os.path.join(os.path.curdir, 'ArchWSL.sln') MS_BUILD_TARGET = "Build"