Use x64 emulation for Windows on Arm targets

windows-386 packages have started to bit-rot, use the windows-x64
versions instead (this implicitly restricts us to Windows 11)

Change-Id: If5417e9463914d9cb7b2e738ff46ef0faea4d1ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4116709
Commit-Queue: Richard Townsend <richard.townsend@arm.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
changes/09/4116709/5
Richard Townsend 2 years ago committed by LUCI CQ
parent aec39c38f8
commit 1b4407e7c6

@ -10,7 +10,6 @@ from __future__ import print_function
import platform
import re
def HostArch():
"""Returns the host architecture with a predictable string."""
host_arch = platform.machine().lower()
@ -36,6 +35,14 @@ def HostArch():
elif host_arch.startswith('riscv'):
host_arch = 'riscv64'
if host_arch == 'arm64':
host_platform = platform.architecture()
if len(host_platform) > 1:
if host_platform[1].lower() == 'windowspe':
# Special case for Windows on Arm: windows-386 packages no longer work
# so use the x64 emulation (this restricts us to Windows 11). Python
# 32-bit returns the host_arch as arm64, 64-bit does not.
return 'x64'
# platform.machine is based on running kernel. It's possible to use 64-bit
# kernel with 32-bit userland, e.g. to give linker slightly more memory.

@ -38,6 +38,8 @@ class DetectHostArchTest(unittest.TestCase):
('aarch64', '', [''], 'arm64'),
('aarch64', '', ['32bit'], 'arm'),
('arm64', '', [''], 'arm64'),
('amd64', 'ARMv8 (64-bit) Family', ['64bit', 'WindowsPE'], 'x64'),
('arm64', 'ARMv8 (64-bit) Family', ['32bit', 'WindowsPE'], 'x64'),
('mips64', '', [''], 'mips64'),
('mips', '', [''], 'mips'),
('ppc', '', [''], 'ppc'),

Loading…
Cancel
Save