'./mach configure' fails to find zipalign when using Android NDK/SDK installed via Homebrew

RESOLVED FIXED in mozilla29

Status

Firefox Build System
General
RESOLVED FIXED
5 years ago
3 months ago

People

(Reporter: James Gilbertson, Assigned: James Gilbertson)

Tracking

unspecified
mozilla29
x86_64
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Homebrew distributes the various sub-directories of the Android SDK to different locations inside /usr/local/, and uses symlinks to stitch the SDK root directory back together (in "/usr/local/opt/android-sdk"). So when configure tries to find 'android_sdk_root' via a relative path (e.g. "/usr/local/opt/android-sdk/platforms/android-19/../../"), it ends up in "/usr/local/var/lib/android-sdk", which doesn't have the "tools" directory.

Using parameter expansion (i.e. ${withval%/platforms/android-*}) instead works.

Steps to reproduce:
Follow the instructions at https://wiki.mozilla.org/Mobile/Fennec/Android#Mac_OS_X with the following changes:
For "Install Android NDK/SDK", use Homebrew to install the NDK/SDK instead (i.e. brew install android-sdk android-ndk)

For "Setup Fennec mozconfig", use the following for the NDK/SDK locations:
ac_add_options --with-android-ndk="/usr/local/opt/android-ndk"
ac_add_options --with-android-sdk="/usr/local/opt/android-sdk/platforms/android-19"

Result:
james.gilbertson@blasted-church ~/D/mozilla> ./mach configure
...
 0:06.30 configure: error: The program zipalign was not found.  Use --with-android-sdk={android-sdk-dir}.
 0:06.30 *** Fix above errors and then restart with               "/Applications/Xcode.app/Contents/Developer/usr/bin/make -f client.mk build"
 0:06.30 make: *** [configure] Error 1
(Assignee)

Comment 1

5 years ago
Created attachment 8346364 [details] [diff] [review]
homebrew-android_sdk_root.patch
Attachment #8346364 - Flags: review?(mh+mozilla)
Attachment #8346364 - Flags: review?(mh+mozilla) → review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/7c1b16d368f1
Assignee: nobody → james.gilbertson
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/7c1b16d368f1
Status: UNCONFIRMED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29

Updated

3 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.