From 973788f88dab9150c345c9c2f3e705cbc36388a2 Mon Sep 17 00:00:00 2001 From: Milad Farazmand Date: Mon, 11 Mar 2019 19:44:11 +0000 Subject: [PATCH] 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 Commit-Queue: Dirk Pranke --- detect_host_arch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/detect_host_arch.py b/detect_host_arch.py index b0dc69314..3b0cc0bf7 100755 --- a/detect_host_arch.py +++ b/detect_host_arch.py @@ -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'