Skip to content

fx-dev-playground/gecko-workflow-instruction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

gecko-workflow-instruction

An instruction of how to develope Gecko/Firefox in git

Prerequisites

Linux

  • wget -q https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py -O bootstrap.py && python bootstrap.py

MacOSX

  • curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py > bootstrap.py && python bootstrap.py

Windows

  • 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...

git-cinnabar

  • 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

Work with github (optional)

  • If you need a place to share your patches between different work machines...
  • Github is an option
git remote add github https://github.com/<user>/gecko.git
git checkout central/default
git checkout -b default
git push -u github default

mach (German for do)

  • 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...

try server

  • Get Level 1 Access first!!! #
  • 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

mozreview

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 Username
    • bz.apikey - Bugzilla API Key
    • mozreview.nickname
  • git mozreview configure
  • mozreview - usage
    • Commit Format - Bug XXXX - Commit description.; r?reviewer
    • git mozreview push
    • Bug 1259355 for practicing mozreview

Interacting with Bugzilla - git-bz-moz

  • 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!

Attach a HG patch manually

  • 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

MacOSX

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

Ubuntu/Debian Linux

  • 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

About

An instruction of how to develope Gecko/Firefox in git

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •