diff options
-rwxr-xr-x | build/detect_host_arch.py | 16 | ||||
-rwxr-xr-x | chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py | 13 |
2 files changed, 14 insertions, 15 deletions
diff --git a/build/detect_host_arch.py b/build/detect_host_arch.py index 638dd68..19579eb 100755 --- a/build/detect_host_arch.py +++ b/build/detect_host_arch.py @@ -10,13 +10,8 @@ import re import sys -def main(): - print DoMain([]) - return 0 - -def DoMain(_): - """Hook to be called from gyp without starting a separate python - interpreter.""" +def HostArch(): + """Returns the host architecture with a predictable string.""" host_arch = platform.machine() # Convert machine type to format recognized by gyp. @@ -36,5 +31,10 @@ def DoMain(_): return host_arch +def DoMain(_): + """Hook to be called from gyp without starting a separate python + interpreter.""" + return HostArch() + if __name__ == '__main__': - sys.exit(main()) + print DoMain([]) diff --git a/chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py b/chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py index ca198f4..ab888f3 100755 --- a/chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py +++ b/chrome/test/nacl_test_injection/buildbot_chrome_nacl_stage.py @@ -15,6 +15,11 @@ import sys import find_chrome +THIS_DIR = os.path.abspath(os.path.dirname(__file__)) +CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..')) +sys.path.append(os.path.join(CHROMIUM_DIR, 'build')) +import detect_host_arch + # Copied from buildbot/buildbot_lib.py def TryToCleanContents(path, file_name_filter=lambda fn: True): @@ -149,17 +154,11 @@ def BuildAndTest(options): bits = 32 scons = [python, 'scons.py'] else: - p = subprocess.Popen( - 'uname -m | ' - 'sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/"', - shell=True, stdout=subprocess.PIPE) - (p_stdout, _) = p.communicate() - assert p.returncode == 0 if options.bits == 64: bits = 64 elif options.bits == 32: bits = 32 - elif p_stdout.find('64') >= 0: + elif '64' in detect_host_arch.HostArch(): bits = 64 else: bits = 32 |