Revision 101096 of Getting comm-central Source Code Using Mercurial

  • Revision slug: Developer_Guide/Source_Code/Getting_comm-central
  • Revision title: Getting comm-central Source Code Using Mercurial
  • Revision id: 101096
  • Created:
  • Creator: Sipaq
  • Is current revision? No
  • Comment no wording changes

Revision Content

{{ :en/Build_Documentation/TOC() }}

 

Mercurial is a source-code management tool which allows users to keep track of changes to the source code locally and share their changes with others. The Mozilla project is in transition from using CVS for Mozilla 1.9 development to Mercurial for Mozilla 1.9.1 development and onwards.

{{ Note("If you want to contribute patches to Thunderbird 2.0, SeaMonkey 1.1 or Firefox 3.0 development, use CVS.") }}

Client Settings

The settings are the same as for the core Firefox 3/xulrunner 1.9.1 development. See

Mozilla_Source_Code_(Mercurial)#Client_settings.

Checking out a source tree

There are multiple hg repositories hosted at mozilla.org, see http://hg.mozilla.org/ for the full list.
The integration repository for Thunderbird 3.0/SeaMonkey 2.0/Sunbird 1.0 development is
comm-central
. It contains the code needed by Thunderbird, Sunbird and SeaMonkey.

To check out from comm-central ("clone" the repository, using Mercurial terminology):

# Pull the Mozilla source to the folder src/ - may take a while 
# as hundreds of megabytes of history is downloaded to .hg
hg clone http://hg.mozilla.org/comm-central/ src

cd src

{{ Note("If you already have a mozilla-central checkout, you can at this stage move it into the mozilla directory under src and avoid pulling mozilla-central again.") }}

update/pull all other needed source via client.py:

python client.py checkout

{{ Note("If you get the error message \"No module named subprocess\", you need to install python 2.4 or later") }}

If you don't run client.py, it won't build. client.py does several things:

  • Pulls the core
  • mozilla-central codebase (Firefox 3.1/xulrunner 1.9.1) into mozilla/
  • Pulls the following directories from cvs (the directories prefixed by extensions/ go into mozilla/extensions):
    • extensions/irc (Chatzilla)
    • extensions/typeaheadfind
    • extensions/venkman
    • extensions/wallet
    • directory/c-sdk
  • Runs a 'hg pull' to pull changes. This is not required (in fact, you may prefer to pull manually). Pass --skip-comm to client.py to skip this.

{{ Note("This step will download hundreds of megabytes of data. This can take a while, depending on your network connection.") }}


{{ Note("Pulling in the related repositories means that you can use the same source directories to develop and build any of the items mentioned above, but does not mean that you can create cross-repository change sets. Patches that span repositories will require multiple changesets.") }}

Building

Thunderbird and SeaMonkey

 

Configure and build as usual using a .mozconfig file and make -f client.mk:
# Enter the source directory
cd src

# Generate a mozconfig yourself, or use this minimal default one for Thunderbird
echo 'ac_add_options --enable-application=mail' > .mozconfig

# Builds with the object directory the same as the source directory are not
# supported, so set the object directory here. Note: Whether you have the
# object directory within the source directory is up to you. .hgignore includes
# objdir-* and obj-*, making your object directory start with one of them
# will make change finding easier and hg faster, but moving it to outside
# will make things like grep easier and quicker as well.
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../objdir-tb' >> .mozconfig

# configure will be automatically generated using the 'autoconf-2.13'
# command.  If autoconf-2.13 isn't the right name for your system, as
# is the case on OS X using MacPorts and on Ubuntu Linux, use the 
# real command name as demonstrated below. (Note: it's "autoconf2.13"
# rather than "autoconf213" for Ubuntu 8.04, at least.)
echo 'mk_add_options AUTOCONF=autoconf213' >> .mozconfig

# Now do the build; configure will be run automatically
make -f client.mk build

{{ Note("The dist directory for the output will now be under objdir/mozilla rather than just objdir/") }}

{{ Note("Just doing make -f client.mk will not update the code anymore! You need to run python client.py checkout before!") }}

Sunbird and Lightning

Configuring and building Sunbird is quite similar to building Thunderbird, with exception of enablling a different application:

# Enter the source directory
cd src

# Generate a mozconfig yourself, or use this minimal default one for Sunbird
echo 'ac_add_options --enable-application=calendar' > .mozconfig

# Builds with the object directory the same as the source directory are not
# supported, so set the object directory here. Note: Whether you have the
# object directory within the source directory is up to you. .hgignore includes
# objdir-* and obj-*, making your object directory start with one of them
# will make change finding easier and hg faster, but moving it to outside
# will make things like grep easier and quicker as well.
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../objdir-sb' >> .mozconfig

# configure will be automatically generated using the 'autoconf-2.13'
# command.  If autoconf-2.13 isn't the right name for your system, as
# is the case on OS X using MacPorts and on Ubuntu Linux, use the 
# real command name as demonstrated below. (Note: it's "autoconf2.13"
# rather than "autoconf213" for Ubuntu 8.04, at least.)
echo 'mk_add_options AUTOCONF=autoconf213' >> .mozconfig

# Now do the build; configure will be run automatically
make -f client.mk build

To build Lightning, follow either the instructions to configure Thunderbird or Sunbird above and then add the --enable-calendar option to your mozconfig. This will install Lightning as a global extension into Thunderbird, or when compiling Sunbird only provide the extension in src/../objdir-sb/mozilla/dist/xpi-stage/. See this section for information on how to easily integrate Lightning into a nightly version of Thunderbird.

# Enter the source directory
cd src

# Add calendaring to thunderbird
echo 'ac_add_options --enable-calendar' >> .mozconfig

After you have completed a full build, if you would like to rebuild Lightning you don't need to go through the whole build process:

# Enter the calendar directory in the object-directory
cd src/../objdir-tb/calendar

# Make the Lightning extension
make -C lightning

Firefox and xulrunner

You can, if needed, build Firefox or xulrunner from this tree. As client.py pulls the mozilla-central repository, builds and development of Firefox and xulrunner can take place within a repository from comm-central. The only difference is that you will need to go into the mozilla/ directory before running the build command:

cd src/mozilla
make -f client.mk build

See Also

{{ languages( { "fr": "fr/Code_source_de_comm-central_(Mercurial)" } ) }}

Revision Source

<p>{{ :en/Build_Documentation/TOC() }}</p>
<p> </p><a href="/en/Mercurial" title="en/Mercurial">Mercurial</a> is a source-code management tool which allows users to keep track of changes to the source code locally and share their changes with others. The Mozilla project is in transition from using <a href="/en/Mozilla_Source_Code_(CVS)" title="en/Mozilla_Source_Code_(CVS)">CVS</a> for Mozilla 1.9 development to Mercurial for Mozilla 1.9.1 development and onwards.
<p>{{ Note("If you want to contribute patches to Thunderbird 2.0, SeaMonkey 1.1 or Firefox 3.0 development, use <a href='\"en/Mozilla_Source_Code_(CVS)\"'>CVS</a>.") }}</p>
<h3 name="Client_Settings">Client Settings</h3>
<p>The settings are the same as for the core Firefox 3/xulrunner 1.9.1 development. See <br>
</p><a href="/en/Mozilla_Source_Code_(Mercurial)#Client_settings" title="en/Mozilla_Source_Code_(Mercurial)#Client_settings">Mozilla_Source_Code_(Mercurial)#Client_settings</a>.
<h3 name="Checking_out_a_source_tree">Checking out a source tree</h3>
<p>There are multiple hg repositories hosted at mozilla.org, see <a class=" external" href="http://hg.mozilla.org/" rel="freelink">http://hg.mozilla.org/</a> for the full list. <br>
The integration repository for Thunderbird 3.0/SeaMonkey 2.0/Sunbird 1.0 development is <a href="/en/comm-central" title="en/comm-central"><br>
comm-central</a>. It contains the code needed by Thunderbird, Sunbird and SeaMonkey.</p>
<p>To check out from comm-central ("clone" the repository, using Mercurial terminology):</p>
<pre class="eval"># Pull the Mozilla source to the folder src/ - may take a while 
# as hundreds of megabytes of history is downloaded to .hg
hg clone <span class="nowiki">http://hg.mozilla.org/comm-central/</span> src

cd src
</pre>
<p>{{ Note("If you already have a mozilla-central checkout, you can at this stage move it into the mozilla directory under src and avoid pulling mozilla-central again.") }}</p>
<p>update/pull all other needed source via client.py:</p>
<pre class="eval">python client.py checkout
</pre>
<p>{{ Note("If you get the error message \"No module named subprocess\", you need to install python 2.4 or later") }}</p>
<p>If you don't run client.py, it won't build. client.py does several things:</p>
<ul> <li>Pulls the core</li> <a href="/en/mozilla-central" title="en/mozilla-central"> mozilla-central</a> codebase (Firefox 3.1/xulrunner 1.9.1) into mozilla/ <li>Pulls the following directories from cvs (the directories prefixed by extensions/ go into mozilla/extensions):<br> <ul> <li>extensions/irc (Chatzilla)</li> <li>extensions/typeaheadfind</li> <li>extensions/venkman</li> <li>extensions/wallet</li> <li>directory/c-sdk</li> </ul> </li> <li>Runs a 'hg pull' to pull changes. This is not required (in fact, you may prefer to pull manually). Pass --skip-comm to client.py to skip this.</li>
</ul>
<p>{{ Note("This step will download hundreds of megabytes of data. This can take a while, depending on your network connection.") }}</p>
<p><br>
{{ Note("Pulling in the related repositories means that you can use the same source directories to develop and build any of the items mentioned above, but does not mean that you can create cross-repository change sets. Patches that span repositories will require multiple changesets.") }}</p><h3 name="Building">Building</h3>
<h4 name="Thunderbird_and_SeaMonkey">Thunderbird and SeaMonkey</h4>
<p> </p><a href="/en/Configuring_Build_Options" title="en/Configuring_Build_Options">Configure</a> and build as usual using a <code>.mozconfig</code> file and <code>make -f client.mk</code>:
<pre class="eval"># Enter the source directory
cd src

# Generate a mozconfig yourself, or use this minimal default one for Thunderbird
echo 'ac_add_options --enable-application=mail' &gt; .mozconfig

# Builds with the object directory the same as the source directory are not
# supported, so set the object directory here. Note: Whether you have the
# object directory within the source directory is up to you. .hgignore includes
# objdir-* and obj-*, making your object directory start with one of them
# will make change finding easier and hg faster, but moving it to outside
# will make things like grep easier and quicker as well.
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../objdir-tb' &gt;&gt; .mozconfig

# configure will be automatically generated using the 'autoconf-2.13'
# command.  If autoconf-2.13 isn't the right name for your system, as
# is the case on OS X using MacPorts and on Ubuntu Linux, use the 
# real command name as demonstrated below. (Note: it's "autoconf2.13"
# rather than "autoconf213" for Ubuntu 8.04, at least.)
echo 'mk_add_options AUTOCONF=autoconf213' &gt;&gt; .mozconfig

# Now do the build; configure will be run automatically
make -f client.mk build
</pre>
<p>{{ Note("The dist directory for the output will now be under <code><i>objdir</i>/mozilla</code> rather than just <code><i>objdir</i>/</code>") }}</p>
<p>{{ Note("Just doing <code>make -f client.mk</code> will <b>not</b> update the code anymore! You <b>need</b> to run <code>python client.py checkout</code> before!") }}</p>
<h4>Sunbird and Lightning</h4>
<p>Configuring and building Sunbird is quite similar to building Thunderbird, with exception of enablling a different application:</p>
<pre class="eval"># Enter the source directory
cd src

# Generate a mozconfig yourself, or use this minimal default one for Sunbird
echo 'ac_add_options --enable-application=calendar' &gt; .mozconfig

# Builds with the object directory the same as the source directory are not
# supported, so set the object directory here. Note: Whether you have the
# object directory within the source directory is up to you. .hgignore includes
# objdir-* and obj-*, making your object directory start with one of them
# will make change finding easier and hg faster, but moving it to outside
# will make things like grep easier and quicker as well.
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../objdir-sb' &gt;&gt; .mozconfig

# configure will be automatically generated using the 'autoconf-2.13'
# command.  If autoconf-2.13 isn't the right name for your system, as
# is the case on OS X using MacPorts and on Ubuntu Linux, use the 
# real command name as demonstrated below. (Note: it's "autoconf2.13"
# rather than "autoconf213" for Ubuntu 8.04, at least.)
echo 'mk_add_options AUTOCONF=autoconf213' &gt;&gt; .mozconfig

# Now do the build; configure will be run automatically
make -f client.mk build
</pre>
<p>To build Lightning, follow either the instructions to configure Thunderbird or Sunbird above and then add the <code>--enable-calendar</code> option to your mozconfig. This will install Lightning as a global extension into Thunderbird, or when compiling Sunbird only provide the extension in <code>src/../objdir-sb/mozilla/dist/xpi-stage/</code>. See <a class="internal" href="/en/Setting_up_extension_development_environment#Custom_code_location" title="En/Setting up extension development environment#Custom code location"> this section</a> for information on how to easily integrate Lightning into a nightly version of Thunderbird.</p>
<pre># Enter the source directory
cd src

# Add calendaring to thunderbird
echo 'ac_add_options --enable-calendar' &gt;&gt; .mozconfig
</pre>
<p>After you have completed a full build, if you would like to rebuild Lightning you don't need to go through the whole build process:</p>
<pre># Enter the calendar directory in the object-directory
cd src/../objdir-tb/calendar

# Make the Lightning extension
make -C lightning
</pre><h4 name="Firefox_and_xulrunner">Firefox and xulrunner</h4>
<p>You can, if needed, build Firefox or xulrunner from this tree. As client.py pulls the mozilla-central repository, builds and development of Firefox and xulrunner can take place within a repository from comm-central. The only difference is that you will need to go into the mozilla/ directory before running the build command:</p>
<pre class="eval">cd src/mozilla
make -f client.mk build
</pre>
<h3 name="See_Also">See Also</h3>
<ul><a href="/en/comm-central" title="en/comm-central">comm-central</a> <a href="/en/Mercurial" title="en/Mercurial">Mercurial</a> <a href="/en/Mercurial_FAQ" title="en/Mercurial_FAQ">Mercurial FAQ</a> <a href="/en/Mozilla_Source_Code_(Mercurial)" title="en/Mozilla_Source_Code_(Mercurial)">Mozilla_Source_Code_(Mercurial)</a></ul> <p>{{ languages( { "fr": "fr/Code_source_de_comm-central_(Mercurial)" } ) }}</p>
Revert to this revision