summaryrefslogtreecommitdiffstats
path: root/testing/marionette/doc/Building.md
blob: e2b84c17faf6e2f7440fdcd8ef19b012d7f6d69d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Building
========

Marionette is built in to Firefox and ships in the official
Firefox binary.  As Marionette is written in [XPCOM] flavoured
JavaScript, you may choose to rely on so called [artifact builds],
which will download pre-compiled Firefox blobs to your computer.
This means you don’t have to compile Firefox locally, but does
come at the cost of having a good internet connection.  To enable
[artifact builds] you may choose ‘Firefox for Desktop Artifact
Mode’ when bootstrapping.

Once you have a clone of [mozilla-unified], you can set up your
development environment by running this command and following the
on-screen instructions:

	% ./mach bootstrap

When you're getting asked to choose the version of Firefox you want to build,
you may want to consider choosing "Firefox for Desktop Artifact Mode".  This
significantly reduces the time it takes to build Firefox on your machine
(from 30+ minutes to just 1-2 minutes) if you have a fast internet connection.

To perform a regular build, simply do:

	% ./mach build

You can clean out the objdir using this command:

	% ./mach clobber

Occasionally a clean build will be required after you fetch the
latest changes from mozilla-central.  You will find that the the
build will error when this is the case.  To automatically do clean
builds when this happens you may optionally add this line to the
_mozconfig_ file in your top source directory:

	mk_add_options AUTOCLOBBER=1

If you compile Firefox frequently you will also want to enable
[ccache] and [sccache] if you develop on a macOS or Linux system:

	mk_add_options 'export RUSTC_WRAPPER=sccache'
	mk_add_options 'export CCACHE_CPP2=yes'
	ac_add_options --with-ccache

[mozilla-unified]: https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/unifiedrepo.html
[artifact builds]: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Artifact_builds
[ccache]: https://ccache.samba.org/
[sccache]: https://github.com/mozilla/sccache