Build/Firefox For Apple Arm: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Ports Firefox + Apple Arm instructions from this Google Doc: https://docs.google.com/document/d/1N5yfEVEISofMmjAxfj3xXONGwyQYBSilsfXqux_M6TM/edit#)
 
(Delete page since it's already out-of-date and ARM setup will happen automatically soon)
 
Line 1: Line 1:
Building Firefox to run on Arm macOS machines is less straightforward than
for x86-64 macOS machines.


Using these instructions, you can either build directly on an Arm macOS machine,
or cross-compile from one that is x86-64.
== Building on Arm macOS ==
# If you installed Rust with older instructions, start by uninstall rustup: <code>rustup self uninstall</code>
# Install Rust via https://rustup.rs.
# Install Rosetta 2: <code>softwareupdate --install-rosetta</code>
# <code>./mach bootstrap</code> doesn't work here, so we need to do some manual steps:
## <code>./mach create-mach-environment</code>. Ignore the error.
## <code>./mach artifact toolchain --from-build macosx64-node</code>
## <code>mv node ~/.mozbuild</code>
# <code>./mach build</code>. It should take about 30 minutes on a DTK, or less than 20 minutes on a M1 Mac Mini or Macbook pro. If it takes more, ensure you have nothing else than node running as Intel (check the activity monitor during the build).
== Building on x86-64 macOS ==
# Install Xcode >= 12.3 or corresponding Command Line Tools.
# <code>./mach bootstrap</code>
# <code>rustup update</code>
# <code>rustup target add aarch64-apple-darwin</code>
# Create a <code>mozconfig</code> file at the top of your repository with <code>ac_add_options --target=aarch64</code> as the contents.
# <code>./mach build</code>
# <code>./mach package</code> to create a <code>.dmg</code> to copy to your Apple Silicon machine

Latest revision as of 18:10, 3 March 2021