An instruction of how to develope Gecko/Firefox in git
wget -q https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py -O bootstrap.py && python bootstrap.py
curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py > bootstrap.py && python bootstrap.py
- Install git for Windows and select "Check as-is, commit as-is" in Configuration the line ending conversions while installation.
- Install Visual Studio Community 2015
- If VS installation gets stuck on KB2999226, use VS ISO instead Download and install the MozillaBuild package
- For more detail...
- Install Mercurial
pip install mercurial
- Install git-cinnabar
git clone https://github.com/glandium/git-cinnabar.git
git submodule update --init
- Configure PATH
Workflow for Gecko development
- Init
git init gecko
cd gecko
git config fetch.prune true
git config push.default upstream
- Configure Inbound/Central
git remote add central hg::https://hg.mozilla.org/mozilla-central -t branches/default/tip
git remote add inbound hg::https://hg.mozilla.org/integration/mozilla-inbound -t branches/default/tip
git remote set-url --push inbound hg::ssh://hg.mozilla.org/integration/mozilla-inbound
git config remote.central.fetch +refs/heads/branches/*/tip:refs/remotes/central/*
git config remote.inbound.fetch +refs/heads/branches/*/tip:refs/remotes/inbound/*
git config remote.central.fetch +refs/heads/branches/default/tip:refs/remotes/central/default
git config remote.inbound.fetch +refs/heads/branches/default/tip:refs/remotes/inbound/default
- Configure Try
git remote add try hg::https://hg.mozilla.org/try
git config remote.try.skipDefaultUpdate true
git remote set-url --push try hg::ssh://hg.mozilla.org/try
git config remote.try.push +HEAD:refs/heads/branches/default/tip
- Configure fx-team
git remote add fx-team hg::https://hg.mozilla.org/integration/fx-team -t branches/default/tip
git config remote.fx-team.fetch +refs/heads/branches/*/tip:refs/remotes/fx-team/*
git config remote.fx-team.fetch +refs/heads/branches/default/tip:refs/remotes/fx-team/default
- Fetch updates for all remote branches
git remote update
- Note
- gecko-dev and git-cinnabar repo have different git-hash
- Tree Rules/Integration
- If you see locale.Error: unsupported locale setting in Ubuntu, please do these:
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales
- If you need a place to share your patches between different work machines...
- Github is an option
- Fork fx-dev-playground/gecko
- Configure your github remote
git remote add github https://github.com/<user>/gecko.git
git checkout central/default
git checkout -b default
git push -u github default
- Build
./mach build [-jn]
- Clean
./mach clobber
- Run
./mach run
- mochitest
./mach mochitest [path-to-test]
- mochilog - Colorized mochitest log
./mach mochitest | mochilog
- Enable tab completion
source python/mach/bash-completion.sh
- For more detail...
- Get Level 1 Access first!!! #
- Prepare SSH public key #
- Fire a bug! examples
- Get your voucher!
- trychooser - helper to generate try-syntax
- 3 ways to push to try server…
./mach try <TRYCHOOSER_SYNTAX>
- Recommanded!!!
- Use git command to push to try server directly
git commit --allow-empty -m "try: <TRYCHOOSER_SYNTAX>"
git push try
git push-to-try
- Get a mail from Try server
- Subject: try submission 464634fa0673: try: ...
- Links: treeherder + logs
- Review Board
- Configuring mozreview + git
- SSH Configuration
- MozReview Doc
- mozreview - ssh configuration
- Add these lines into ~/.ssh/config and don’t forget to change me
Host hg.mozilla.org
User [email protected]
Host reviewboard-hg.mozilla.org
User [email protected]
- Verify your account
ssh hg.mozilla.org
ssh reviewboard-hg.mozilla.org
- Prepare Bugzilla API Key
- Manually Associating Your LDAP Account
ssh reviewboard-hg.mozilla.org mozreview-ldap-associate
- Enter your Bugzilla e-mail address
- Enter a Bugzilla API Key
- Installing MozReview Git Tools
./mach mercurial-setup
- Then it will clone version-control-tools to ~/.mozbuild/version-control-tools.
export PATH=/path/to/version-control-tools/git/commands:$PATH
git config --global
bz.username
- Bugzilla Usernamebz.apikey
- Bugzilla API Keymozreview.nickname
git mozreview configure
- mozreview - usage
- Commit Format -
Bug XXXX - Commit description.; r?reviewer
git mozreview push
- Bug 1259355 for practicing mozreview
- Commit Format -
- Install git-bz-moz (man page)
- Import a patch from a bug to review
git bz apply <BUG_ID>
- Post a patch to a bug for feedback
git bz attach -ne HEAD
- Prefer MozReview for review requests!
- Use moz-git-tools to generate hg patch
git format-patch HEAD~
git patch-to-hg-patch <git-patch-path>
- However, some reviewers think git patch is acceptable.
- Installing ESLint and Recommended plugins
./mach eslint --setup
- Running ESLint from the command line
./mach eslint path/to/directory
- Release build - .mozconfig
# Automatically download and use compiled C++ components:
ac_add_options --enable-artifact-builds
# Write build artifacts to:
mk_add_options MOZ_OBJDIR=./objdir-frontend
- Debug build - .mozconfig
# Enable debug version of the pre-build binary artifact
export MOZ_DEBUG="1"
# Automatically download and use compiled C++ components:
ac_add_options --enable-artifact-builds
# Write build artifacts to:
mk_add_options MOZ_OBJDIR=./objdir-frontend-debug-artifact
- Install Prerequisites
- Please select a proper scheduler IP address.
xcode-select --install
brew install lzo
git clone https://github.com/mystor/icecc-osx-moztor ~/icecream
sudo ~/icecream/install.sh SCHEDULER_IP_ADDRESS
- Add these two lines in .mozconfig
CC="$HOME/icecream/cc"
CXX="$HOME/icecream/c++"
- Use -j60 to see the significant throughput
./mach build -j60
sudo apt-get install icecc
- Add these two lines in .mozconfig
ac_add_options --with-compiler-wrapper=icecc
ac_add_options --disable-ccache
- Use -j60 to see the significant throughput
./mach build -j60