From 4c990b9eab4d33faf517fcc2080662ebde0d2841 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Mon, 26 Aug 2024 12:25:03 +0200 Subject: [PATCH] Check MSVC arm64 variant on arm64 host (#4555) --- newsfragments/4553.feature.rst | 1 + setuptools/msvc.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 newsfragments/4553.feature.rst diff --git a/newsfragments/4553.feature.rst b/newsfragments/4553.feature.rst new file mode 100644 index 0000000000..43ea1eeac9 --- /dev/null +++ b/newsfragments/4553.feature.rst @@ -0,0 +1 @@ +Added detection of ARM64 variant of MSVC -- by :user:`saschanaz` diff --git a/setuptools/msvc.py b/setuptools/msvc.py index ca332d59aa..57f09417ca 100644 --- a/setuptools/msvc.py +++ b/setuptools/msvc.py @@ -26,6 +26,7 @@ from more_itertools import unique_everseen import distutils.errors +from distutils.util import get_platform # https://github.com/python/mypy/issues/8166 if not TYPE_CHECKING and platform.system() == 'Windows': @@ -89,8 +90,9 @@ def _msvc14_find_vc2017(): if not root: return None, None + variant = 'arm64' if get_platform() == 'win-arm64' else 'x86.x64' suitable_components = ( - "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", + f"Microsoft.VisualStudio.Component.VC.Tools.{variant}", "Microsoft.VisualStudio.Workload.WDExpress", )