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/+/1504554
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
changes/54/1504554/3
Milad Farazmand 6 years ago committed by Commit Bot
parent 53aa75c9ce
commit 973788f88d

@ -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'

Loading…
Cancel
Save