File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 1+ In setuptools.msvc.EnvironmentInfo, now honor the correct paths when on an ARM host.
Original file line number Diff line number Diff line change @@ -1024,6 +1024,16 @@ def VCTools(self):
10241024 ------
10251025 list of str
10261026 paths
1027+
1028+ When host CPU is ARM, the tools should be found for ARM.
1029+
1030+ >>> getfixture('windows_only')
1031+ >>> mp = getfixture('monkeypatch')
1032+ >>> mp.setattr(PlatformInfo, 'current_cpu', 'arm64')
1033+ >>> ei = EnvironmentInfo(arch='irrelevant')
1034+ >>> paths = ei.VCTools
1035+ >>> any('HostARM64' in path for path in paths)
1036+ True
10271037 """
10281038 si = self .si
10291039 tools = [os .path .join (si .VCInstallDir , 'VCPackages' )]
@@ -1038,9 +1048,8 @@ def VCTools(self):
10381048 tools += [os .path .join (si .VCInstallDir , path )]
10391049
10401050 elif self .vs_ver >= 15.0 :
1041- host_dir = (
1042- r'bin\HostX86%s' if self .pi .current_is_x86 () else r'bin\HostX64%s'
1043- )
1051+ host_id = self .pi .current_cpu .replace ('amd64' , 'x64' ).upper ()
1052+ host_dir = os .path .join ('bin' , f'Host{ host_id } %s' )
10441053 tools += [
10451054 os .path .join (si .VCInstallDir , host_dir % self .pi .target_dir (x64 = True ))
10461055 ]
You can’t perform that action at this time.
0 commit comments