From c322db38f93018e13c536e4e9d3a808b211def3c Mon Sep 17 00:00:00 2001 From: Nick Alexander Date: Thu, 8 Jan 2015 13:47:42 -0800 Subject: [PATCH] Bug 1117357 - Fix |mach bootstrap| for mobile/android on Mac OS X. r=gps This does two things. First, it aligns the brew formula name (AndroidNdk) with the brew file name (android-ndk.rb). Second, it makes sure that we actually find the android-ndk.rb file. I think |mach bootstrap| always worked, due to a felicity where the working directory always contained android-ndk.rb; but |python bootstrap.py| failed because android-ndk.rb was downloaded to a temporary location that was not included in the |brew install| command. --HG-- rename : python/mozboot/mozboot/android-ndk-r8e.rb => python/mozboot/mozboot/android-ndk.rb extra : rebase_source : 44f164d3d5916bc2faf4c64285e232047daea35e --- python/mozboot/bin/bootstrap.py | 2 +- .../mozboot/mozboot/{android-ndk-r8e.rb => android-ndk.rb} | 4 ++++ python/mozboot/mozboot/osx.py | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) rename python/mozboot/mozboot/{android-ndk-r8e.rb => android-ndk.rb} (85%) diff --git a/python/mozboot/bin/bootstrap.py b/python/mozboot/bin/bootstrap.py index 8fae9e77827..c743fbea491 100755 --- a/python/mozboot/bin/bootstrap.py +++ b/python/mozboot/bin/bootstrap.py @@ -32,7 +32,7 @@ REPOSITORY_PATH_PREFIX = 'python/mozboot' REPOSITORY_PATHS = [ 'mozboot/__init__.py', - 'mozboot/android-ndk-r8e.rb', + 'mozboot/android-ndk.rb', 'mozboot/android.py', 'mozboot/base.py', 'mozboot/bootstrap.py', diff --git a/python/mozboot/mozboot/android-ndk-r8e.rb b/python/mozboot/mozboot/android-ndk.rb similarity index 85% rename from python/mozboot/mozboot/android-ndk-r8e.rb rename to python/mozboot/mozboot/android-ndk.rb index 989b835b34d..6aa8d8946c0 100644 --- a/python/mozboot/mozboot/android-ndk-r8e.rb +++ b/python/mozboot/mozboot/android-ndk.rb @@ -1,5 +1,9 @@ require "formula" +# This is an antiquated version pinned to NDK revision r8e. That's +# the revision Mozilla's automation currently uses. We could push +# this to https://github.com/Homebrew/homebrew-versions if there's a +# problem shipping it locally. class AndroidNdk < Formula homepage "http://developer.android.com/sdk/ndk/index.html" diff --git a/python/mozboot/mozboot/osx.py b/python/mozboot/mozboot/osx.py index fd5a80f402a..bae1058f704 100644 --- a/python/mozboot/mozboot/osx.py +++ b/python/mozboot/mozboot/osx.py @@ -324,11 +324,16 @@ class OSXBootstrapper(BaseBootstrapper): def ensure_homebrew_mobile_android_packages(self): import android + # If we're run from a downloaded bootstrap.py, then android-ndk.rb is + # fetched into a temporary directory. This finds that directory. + import inspect + path_to_android = os.path.abspath(os.path.dirname(inspect.getfile(android))) + # We don't need wget because we install the Android SDK and NDK from # packages. If we used the android.py module, we'd need wget. packages = [ ('android-sdk', 'android-sdk'), - ('android-ndk', 'android-ndk-r8e.rb'), # This is a locally provided brew formula! + ('android-ndk', os.path.join(path_to_android, 'android-ndk.rb')), # This is a locally provided brew formula! ('ant', 'ant'), ('brew-cask', 'caskroom/cask/brew-cask'), # For installing Java later. ]