General steps for building older versions of Firefox for Android

Step 0: Have a current working build environment for building Firefox for Android for a recent checkout of mozilla-central.

Step 1: Figure out when the revision you are interested in was checked in. hg log -r <revision> will give you a date of the checkin.

Step 2: Check the revision history of the Simple Firefox for Android build guide you want to find a revision slightly before the date from step 1. At the bottom of the page “Required Android SDK and NDK versions” use this section as a reference for the next several steps.

Step 3. Install the version of the Android SDK Platform listed on the DevMo page. Via Android Studio’s SDK manager. Tools -> SDK Manager -> SDK Platforms ->  mark the API version you need -> click apply

Step 4. Install the SDK build tools using Android Studio’s SDK manager. Tools -> SDK Manager -> SDK Tools -> mark the SDK build tools version you need -> click apply

Step 5. Get the correct NDK from Google’s archives. Then extract it to where you store your NDKs. $HOME/.mozbuild is the default.

Step 6. Get the Android SDK tools. This can be a real pain as Google does not have links to download this. You will need to craft your own version of the URL. The URL format is<version>-<operating-system>.zip Where version matches the “Android SDK Tools” line from DevMo and operating system is macosx or linux. Example

Step 7. Create a copy of the SDK, delete the tools directory and place the folder from the Android SDK Tools download step 6 above in that folder. Example $HOME/.mozbuild/android-sdk-linux-23.0.1/

Step 8. Update your .mozconfig to point to the older NDK and SDK versions
# Build Firefox for Android:
ac_add_options --enable-application=mobile/android
ac_add_options --target=arm-linux-androideabi
# With the following Android SDK and NDK:
ac_add_options --with-android-sdk="/absolute/path/to/android-sdk-linux-23.0.1"
ac_add_options --with-android-ndk="/absolute/path/to/android-ndk-r11c"

Step 9. ./mach build
./mach package
./mach install
./mach run

Servo python build error Windows 10

Compiling Servo on Windows 10 I hit the following error

./mach build -r
<time passes>
--- stderr
thread '<main>' panicked at 'Can't find python (tried python27.exe and python.exe)! Try fixing PATH or setting the PYTHON env var', C:\msys64\home\kbrosnan\src\servo\components\style\
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Setting the python environment variable allowed the build to succeed. export PYTHON=/c/Python27/python.exe