Commit 973788f8 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

Fixing getting machine arch on AIX running in an LPAR environment

Trying to get "host_cpu" in DEPS file may fail on AIX.
Getting the "machine ID number" using "uname -m" on an AIX box, in an LPAR
environment will not generate a unique machine identifier and instead might
return a string such as "00f9445f4c00". "platform.processor()" will be used
as a fall back on AIX.

Change-Id: I7fada10059e29066f5a13d6135b01eaeaccb769d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1504554Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
parent 53aa75c9
......@@ -13,6 +13,7 @@ import sys
def HostArch():
"""Returns the host architecture with a predictable string."""
host_arch = platform.machine().lower()
host_processor = platform.processor().lower()
# Convert machine type to format recognized by gyp.
if re.match(r'i.86', host_arch) or host_arch == 'i86pc':
......@@ -27,7 +28,7 @@ def HostArch():
host_arch = 'mips64'
elif host_arch.startswith('mips'):
host_arch = 'mips'
elif host_arch.startswith('ppc'):
elif host_arch.startswith('ppc') or host_processor == 'powerpc':
host_arch = 'ppc'
elif host_arch.startswith('s390'):
host_arch = 's390'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment