Bug 1477487 - Part 3: Make |mach bootstrap| for Android install Rust toolchains. r=agi
authorNick Alexander <nalexander@mozilla.com>
Thu, 17 Jan 2019 21:31:12 +0000
changeset 511455 dc41aecedaac40fa9d7850f7a2bec5631ca5cea6
parent 511454 bbfe0cbb90b4d17d53773914f2f3753d830af242
child 511456 6f0ec77a2d7e09b3900308e30f0770ef1cb3bc9a
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersagi
bugs1477487
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1477487 - Part 3: Make |mach bootstrap| for Android install Rust toolchains. r=agi Differential Revision: https://phabricator.services.mozilla.com/D16139
python/mozboot/mozboot/android.py
python/mozboot/mozboot/base.py
--- a/python/mozboot/mozboot/android.py
+++ b/python/mozboot/mozboot/android.py
@@ -48,20 +48,20 @@ Paste the lines between the chevrons (>>
 
 >>>
 # Build GeckoView/Firefox for Android:
 ac_add_options --enable-application=mobile/android
 
 # Targeting the following architecture.  Ensure exactly one --target is uncommented!
 # For regular phones:
 ac_add_options --target=arm-linux-androideabi
+# For x86 emulators (and x86 devices, which are uncommon):
+# ac_add_options --target=i686-linux-android
 # For newer phones.
 # ac_add_options --target=aarch64-linux-android
-# For x86 emulators (and x86 devices, which are uncommon):
-# ac_add_options --target=i686-linux-android
 # For x86_64 emulators (and x86_64 devices, which are even less common):
 # ac_add_options --target=x86_64-linux-android
 
 {extra_lines}
 # With the following Android SDK and NDK:
 ac_add_options --with-android-sdk="{sdk_path}"
 ac_add_options --with-android-ndk="{ndk_path}"
 
--- a/python/mozboot/mozboot/base.py
+++ b/python/mozboot/mozboot/base.py
@@ -685,16 +685,26 @@ class BaseBootstrapper(object):
         print('Rust supports %s targets.' % ', '.join(targets))
 
         # Support 32-bit Windows on 64-bit Windows.
         win32 = 'i686-pc-windows-msvc'
         win64 = 'x86_64-pc-windows-msvc'
         if rust.platform() == win64 and win32 not in targets:
             subprocess.check_call([rustup, 'target', 'add', win32])
 
+        if 'mobile_android' in self.application:
+            # Let's add the most common targets.
+            android_targets = ('armv7-linux-androideabi',
+                               'aarch64-linux-android',
+                               'i686-linux-android',
+                               'x86_64-linux-android', )
+            for target in android_targets:
+                if target not in targets:
+                    subprocess.check_call([rustup, 'target', 'add', target])
+
     def upgrade_rust(self, rustup):
         """Upgrade Rust.
 
         Invoke rustup from the given path to update the rust install."""
         subprocess.check_call([rustup, 'update'])
 
     def install_rust(self):
         """Download and run the rustup installer."""