Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/4786.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In setuptools.msvc.EnvironmentInfo, now honor the correct paths when on an ARM host.
15 changes: 12 additions & 3 deletions setuptools/msvc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,16 @@ def VCTools(self):
------
list of str
paths

When host CPU is ARM, the tools should be found for ARM.

>>> getfixture('windows_only')
>>> mp = getfixture('monkeypatch')
>>> mp.setattr(PlatformInfo, 'current_cpu', 'arm64')
>>> ei = EnvironmentInfo(arch='irrelevant')
>>> paths = ei.VCTools
>>> any('HostARM64' in path for path in paths)
True
"""
si = self.si
tools = [os.path.join(si.VCInstallDir, 'VCPackages')]
Expand All @@ -1038,9 +1048,8 @@ def VCTools(self):
tools += [os.path.join(si.VCInstallDir, path)]

elif self.vs_ver >= 15.0:
host_dir = (
r'bin\HostX86%s' if self.pi.current_is_x86() else r'bin\HostX64%s'
)
host_id = self.pi.current_cpu.replace('amd64', 'x64').upper()
host_dir = os.path.join('bin', f'Host{host_id}%s')
tools += [
os.path.join(si.VCInstallDir, host_dir % self.pi.target_dir(x64=True))
]
Expand Down
Loading