Skip to content

Commit 7665a6e

Browse files
authored
devops: support apple silicon builds of Firefox (#4979)
1 parent 7251919 commit 7665a6e

File tree

3 files changed

+30
-11
lines changed

3 files changed

+30
-11
lines changed

browser_patches/buildbots/buildbot-mac-11.0-arm64.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ fi
6363

6464
git pull origin master
6565
../checkout_build_archive_upload.sh webkit-mac-11.0-arm64 >/tmp/$(basename $0)--webkit-mac-11.0-arm64.log || true
66+
../checkout_build_archive_upload.sh firefox-mac-11.0-arm64 >/tmp/$(basename $0)--firefox-mac-11.0-arm64.log || true

browser_patches/checkout_build_archive_upload.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ elif [[ "$BUILD_FLAVOR" == "firefox-mac-10.14" ]]; then
100100
EXPECTED_HOST_OS="Darwin"
101101
EXPECTED_HOST_OS_VERSION="10.14"
102102
BUILD_BLOB_NAME="firefox-mac-10.14.zip"
103+
elif [[ "$BUILD_FLAVOR" == "firefox-mac-11.0-arm64" ]]; then
104+
BROWSER_NAME="firefox"
105+
EXPECTED_HOST_OS="Darwin"
106+
EXPECTED_HOST_OS_VERSION="11.0"
107+
EXPECTED_ARCH="arm64"
108+
BUILD_BLOB_NAME="firefox-mac-11.0-arm64.zip"
103109
elif [[ "$BUILD_FLAVOR" == "firefox-win32" ]]; then
104110
BROWSER_NAME="firefox"
105111
EXPECTED_HOST_OS="MINGW"

browser_patches/firefox/build.sh

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,30 @@ fi
2323

2424

2525
if [[ "$(uname)" == "Darwin" ]]; then
26-
# Firefox currently does not build on 10.15 out of the box - it requires SDK for 10.12.
27-
# Make sure the SDK is out there.
28-
if ! [[ -d $HOME/SDK-archive/MacOSX${MACOS_SDK_VERSION}.sdk ]]; then
29-
echo "As of Dec 2020, Firefox does not build on Mac without ${MACOS_SDK_VERSION} SDK."
30-
echo "Download XCode ${XCODE_VERSION_WITH_REQUIRED_SDK_VERSION} from https://developer.apple.com/download/more/ and"
31-
echo "extract SDK to $HOME/SDK-archive/MacOSX${MACOS_SDK_VERSION}.sdk"
32-
echo ""
33-
echo "More info: https://firefox-source-docs.mozilla.org/setup/macos_build.html"
34-
exit 1
26+
if [[ $(uname -m) == "arm64" ]]; then
27+
# Building on Apple Silicon requires XCode12.2 and does not require any extra SDKs.
28+
if ! [[ -d "/Applications/Xcode12.2.app" ]]; then
29+
echo "As of Jan 2021, building Firefox on Apple Silicon requires XCode 12.2"
30+
echo "Make sure there's an /Applications/Xcode12.2.app"
31+
echo "Download XCode from https://developer.apple.com/download/more/"
32+
echo ""
33+
exit 1
34+
fi
35+
export DEVELOPER_DIR=/Applications/Xcode12.2.app/Contents/Developer
3536
else
36-
echo "-- configuting .mozconfig with ${MACOS_SDK_VERSION} SDK path"
37-
echo "ac_add_options --with-macos-sdk=$HOME/SDK-archive/MacOSX${MACOS_SDK_VERSION}.sdk/" > .mozconfig
37+
# Firefox currently does not build on 10.15 out of the box - it requires SDK for 10.12.
38+
# Make sure the SDK is out there.
39+
if ! [[ -d $HOME/SDK-archive/MacOSX${MACOS_SDK_VERSION}.sdk ]]; then
40+
echo "As of Dec 2020, Firefox does not build on Mac without ${MACOS_SDK_VERSION} SDK."
41+
echo "Download XCode ${XCODE_VERSION_WITH_REQUIRED_SDK_VERSION} from https://developer.apple.com/download/more/ and"
42+
echo "extract SDK to $HOME/SDK-archive/MacOSX${MACOS_SDK_VERSION}.sdk"
43+
echo ""
44+
echo "More info: https://firefox-source-docs.mozilla.org/setup/macos_build.html"
45+
exit 1
46+
else
47+
echo "-- configuting .mozconfig with ${MACOS_SDK_VERSION} SDK path"
48+
echo "ac_add_options --with-macos-sdk=$HOME/SDK-archive/MacOSX${MACOS_SDK_VERSION}.sdk/" > .mozconfig
49+
fi
3850
fi
3951
echo "-- building on Mac"
4052
elif [[ "$(uname)" == "Linux" ]]; then

0 commit comments

Comments
 (0)