Detect non x86_64 machine in build script.

This change adds functionality to detect whether the
host machine is x86_64, which is the only machine currently supported by
the build script.

Bug: 241967798
Tag: #floss
Test: run ./build.py on non x86_64 and observe script exiting, run on x86_64 and
observe normal behavior.

Change-Id: Ia9837e26c78559e85b00cc8637daa2874cb3d8d8
diff --git a/build.py b/build.py
index cb9f513..b121cad 100755
--- a/build.py
+++ b/build.py
@@ -30,6 +30,7 @@
 import argparse
 import multiprocessing
 import os
+import platform
 import shutil
 import six
 import subprocess
@@ -802,6 +803,11 @@
     # Make sure we get absolute path + expanded path for bootstrap directory
     args.bootstrap_dir = os.path.abspath(os.path.expanduser(args.bootstrap_dir))
 
+    # Possible values for machine() come from 'uname -m'
+    # Since this script only runs on Linux, x86_64 machines must have this value
+    if platform.machine() != 'x86_64':
+        raise Exception("Only x86_64 machines are currently supported by this build script.")
+
     if args.run_bootstrap:
         bootstrap = Bootstrap(args.bootstrap_dir, os.path.dirname(__file__))
         bootstrap.bootstrap()