浏览代码

gclient: Correctly set host_cpu to arm64 on arm macs

platform.machine() is 'arm64' on arm macs, and the `.startswith('arm')`
branch converted that to 'arm' before this CL.

Bug: 1103236,1190880
Change-Id: Idd75a724f059ecd2dd873737e4998fe9bc937e04
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2779414
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@google.com>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
Nico Weber 4 年之前
父节点
当前提交
d4da7ca919
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 2 2
      detect_host_arch.py
  2. 1 0
      tests/detect_host_arch_test.py

+ 2 - 2
detect_host_arch.py

@@ -21,10 +21,10 @@ def HostArch():
     host_arch = 'x86'
     host_arch = 'x86'
   elif host_arch in ['x86_64', 'amd64']:
   elif host_arch in ['x86_64', 'amd64']:
     host_arch = 'x64'
     host_arch = 'x64'
+  elif host_arch == 'arm64' or host_arch.startswith('aarch64'):
+    host_arch = 'arm64'
   elif host_arch.startswith('arm'):
   elif host_arch.startswith('arm'):
     host_arch = 'arm'
     host_arch = 'arm'
-  elif host_arch.startswith('aarch64'):
-    host_arch = 'arm64'
   elif host_arch.startswith('mips64'):
   elif host_arch.startswith('mips64'):
     host_arch = 'mips64'
     host_arch = 'mips64'
   elif host_arch.startswith('mips'):
   elif host_arch.startswith('mips'):

+ 1 - 0
tests/detect_host_arch_test.py

@@ -37,6 +37,7 @@ class DetectHostArchTest(unittest.TestCase):
       ('arm', '', [''], 'arm'),
       ('arm', '', [''], 'arm'),
       ('aarch64', '', [''], 'arm64'),
       ('aarch64', '', [''], 'arm64'),
       ('aarch64', '', ['32bit'], 'arm'),
       ('aarch64', '', ['32bit'], 'arm'),
+      ('arm64', '', [''], 'arm64'),
       ('mips64', '', [''], 'mips64'),
       ('mips64', '', [''], 'mips64'),
       ('mips', '', [''], 'mips'),
       ('mips', '', [''], 'mips'),
       ('ppc', '', [''], 'ppc'),
       ('ppc', '', [''], 'ppc'),