Bug 1854550 - pt 2. Move PHC into memory/build r=glandium
[gecko.git] / remote / doc / marionette / Building.md
blob3d9f44516c605e254cec668550a04fa2d94789b6
1 # Building
3 Marionette is built into Firefox by default and ships in the official
4 Firefox binary.  As Marionette is written in [XPCOM] flavoured
5 JavaScript, you may choose to rely on so called [artifact builds],
6 which will download pre-compiled Firefox blobs to your computer.
7 This means you don’t have to compile Firefox locally, but does
8 come at the cost of having a good internet connection.  To enable
9 [artifact builds] you may choose ‘Firefox for Desktop Artifact
10 Mode’ when bootstrapping.
12 Once you have a clone of [mozilla-unified], you can set up your
13 development environment by running this command and following the
14 on-screen instructions:
16 ```shell
17 ./mach bootstrap
18 ```
20 When you're getting asked to choose the version of Firefox you want to build,
21 you may want to consider choosing "Firefox for Desktop Artifact Mode".  This
22 significantly reduces the time it takes to build Firefox on your machine
23 (from 30+ minutes to just 1-2 minutes) if you have a fast internet connection.
25 To perform a regular build, simply do:
27 ```shell
28 ./mach build
29 ```
31 You can clean out the objdir using this command:
33 ```shell
34 ./mach clobber
35 ```
37 Occasionally a clean build will be required after you fetch the
38 latest changes from mozilla-central.  You will find that the the
39 build will error when this is the case.  To automatically do clean
40 builds when this happens you may optionally add this line to the
41 [mozconfig] file in your top source directory:
43 ```
44 mk_add_options AUTOCLOBBER=1
45 ```
47 If you compile Firefox frequently you will also want to enable
48 [ccache] and [sccache] if you develop on a macOS or Linux system:
50 ```
51 mk_add_options 'export RUSTC_WRAPPER=sccache'
52 mk_add_options 'export CCACHE_CPP2=yes'
53 ac_add_options --with-ccache
54 ```
56 You may also opt out of building all the WebDriver specific components
57 (Marionette, and the [Remote Agent]) by setting the following flag:
59 ```
60 ac_add_options --disable-webdriver
61 ```
63 [mozilla-unified]: https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/unifiedrepo.html
64 [artifact builds]: /contributing/build/artifact_builds.rst
65 [mozconfig]: /build/buildsystem/mozconfigs.rst
66 [ccache]: https://ccache.samba.org/
67 [sccache]: https://github.com/mozilla/sccache
68 [Remote Agent]: /remote/index.rst