Difference between revisions of "Distcc mozilla tutorial"

From CDOT Wiki
Jump to: navigation, search
(Environment)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
=What is this?=
 
=What is this?=
This is a tutorial to get distcc to compile Mozilla Firefox on cygwin.
+
 
 +
This is a tutorial to get distcc to compile Mozilla Firefox on Windows using cygwin.
  
 
=Requirements=
 
=Requirements=
 +
 
# Window machines. For distcc to be of any use, there should be at least 2 machines
 
# Window machines. For distcc to be of any use, there should be at least 2 machines
# Cygwin. You will need gcc to build distcc. We built using gcc-3.4.4
+
# Cygwin. You will need gcc to build distcc. We build using gcc-3.4.4
 
# [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites Mozilla requirements]
 
# [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites Mozilla requirements]
 
# Patience
 
# Patience
 +
 +
=Building distcc=
 +
 +
Checkout, build, and install the distcc source
 +
 +
svn co svn://cdot.senecac.on.ca/distcc/trunk
 +
cd trunk && ./configure && make && make install
 +
 +
Checkout the Mozilla source. If you are using the latest version of trunk, than you are fine. If you are building 2.0.0.3 or below, you need to apply a silly [https://bugzilla.mozilla.org/show_bug.cgi?id=374563 patch].
  
 
=MOZCONFIG=
 
=MOZCONFIG=
Currently, distcc does not transmit debug .pdb files. So you cannot currently do a debug build. Here is a sample MOZCONFIG file. All you need to do is modify the object directory (MOZ_OBJDIR).
+
 
 +
Currently, distcc does not transmit debug .pdb files (i.e., it can only send back one file). So you cannot currently do a debug build. Here is a sample MOZCONFIG file. All you need to do is modify the object directory (MOZ_OBJDIR).
  
 
'''Note the last line''', which is required for any MOZCONFIG file that wants to build using distcc.
 
'''Note the last line''', which is required for any MOZCONFIG file that wants to build using distcc.
Line 20: Line 32:
 
  mk_add_options MOZ_CO_PROJECT=browser
 
  mk_add_options MOZ_CO_PROJECT=browser
 
  mk_add_options MOZ_MAKE_FLAGS="CC='distcc cl' CXX='distcc cl' -j4"
 
  mk_add_options MOZ_MAKE_FLAGS="CC='distcc cl' CXX='distcc cl' -j4"
 +
 +
-j4 is quite important. According to the man page, you should set the number of jobs equal to the number of all cpus (or cores) + 2.
  
 
=Environment=
 
=Environment=
This section explains some usefull environment variables that you can use.
 
  
==Master==
+
The only required environment variable is '''DISTCC_CL_HOSTS''', which contains a space delimited list of all slave machines.  You must set this variable on the master machine (the machine that contains the source code).
The master machine is the machine in which the mozilla directory is located.
+
 
 +
export DISTCC_CL_HOSTS="localhost 10.0.0.2 10.0.0.4"
 +
<!--
 +
This section explains some useful environment variables that you can use.
 +
 
 +
Distcc has a few environment variables. The most useful are listed here, which are all set on the master computer. The master machine is the machine in which the mozilla directory is located.
 +
 
 
<dl>
 
<dl>
 
<dt> DISTCC_CL_HOSTS
 
<dt> DISTCC_CL_HOSTS
 
<dd>the ip addresses of the slave machines. Usually localhost is the first host. '''THIS IS REQUIRED'''
 
<dd>the ip addresses of the slave machines. Usually localhost is the first host. '''THIS IS REQUIRED'''
  
''Example :'' export DISTCC_CL_HOSTS="localhost 10.0.0.2 10.0.0.4
+
''Example :'' export DISTCC_CL_HOSTS="localhost 10.0.0.2 10.0.0.4"
  
 
<dt>DISTCC_VERBOSE
 
<dt>DISTCC_VERBOSE
Line 45: Line 64:
 
Values : 1 for allow fallback
 
Values : 1 for allow fallback
 
</dl>
 
</dl>
 +
-->
 +
 +
=Distcc Daemon=
 +
 +
Start the distcc daemon.  The only thing you need to change is who is allowed to use the daemon.  You can use a space-delimited list of IP addresses, or specify the CIDR mask of an entire subnet.
  
===Slave===
+
distccd --allow '10.0.0.0/24' --daemon
The slaves take preprocessed file and send back the object file. They do not need the source code.
 
<dl>
 
<dt> DISTCC_CL_HOSTS
 
<dd>the ip addresses of the slave machines. Usually localhost is the first host.
 
  
'''Example :''' export DISTCC_CL_HOSTS="localhost 10.0.0.2 10.0.0.4
+
=Compile Mozilla=
<dd>
 
</dl>
 
  
 +
You should now be able to compile Mozilla. You won't notice distributing immediately. But you can monitor the progress using the distcc-text or distcc-gnome utility, or using the 'Task Manager'. Sometimes, mozilla forces -j1 in some directories. So be prepared for that.
  
==Optional==
+
=Complaints=
  
DISTCC_FALLBACK
+
If you feel that these instructions are poorly written, or are having trouble using distcc to compile mozilla because something is unclear, please leave a message in the discussion page. I appreciate any feedback (good/bad) in hopes of improving this documentation.
  
=Check out=
+
You do not have to leave a contact or your name.
=Build=
 

Latest revision as of 17:16, 20 April 2007

What is this?

This is a tutorial to get distcc to compile Mozilla Firefox on Windows using cygwin.

Requirements

  1. Window machines. For distcc to be of any use, there should be at least 2 machines
  2. Cygwin. You will need gcc to build distcc. We build using gcc-3.4.4
  3. Mozilla requirements
  4. Patience

Building distcc

Checkout, build, and install the distcc source

svn co svn://cdot.senecac.on.ca/distcc/trunk
cd trunk && ./configure && make && make install

Checkout the Mozilla source. If you are using the latest version of trunk, than you are fine. If you are building 2.0.0.3 or below, you need to apply a silly patch.

MOZCONFIG

Currently, distcc does not transmit debug .pdb files (i.e., it can only send back one file). So you cannot currently do a debug build. Here is a sample MOZCONFIG file. All you need to do is modify the object directory (MOZ_OBJDIR).

Note the last line, which is required for any MOZCONFIG file that wants to build using distcc.

mk_add_options MOZ_OBJDIR=/cygdrive/c/home/cesar/mozobj
ac_add_options --enable-application=browser
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --enable-debugger-info-modules=no
mk_add_options MOZ_CO_PROJECT=browser
mk_add_options MOZ_MAKE_FLAGS="CC='distcc cl' CXX='distcc cl' -j4"

-j4 is quite important. According to the man page, you should set the number of jobs equal to the number of all cpus (or cores) + 2.

Environment

The only required environment variable is DISTCC_CL_HOSTS, which contains a space delimited list of all slave machines. You must set this variable on the master machine (the machine that contains the source code).

export DISTCC_CL_HOSTS="localhost 10.0.0.2 10.0.0.4"

Distcc Daemon

Start the distcc daemon. The only thing you need to change is who is allowed to use the daemon. You can use a space-delimited list of IP addresses, or specify the CIDR mask of an entire subnet.

distccd --allow '10.0.0.0/24' --daemon

Compile Mozilla

You should now be able to compile Mozilla. You won't notice distributing immediately. But you can monitor the progress using the distcc-text or distcc-gnome utility, or using the 'Task Manager'. Sometimes, mozilla forces -j1 in some directories. So be prepared for that.

Complaints

If you feel that these instructions are poorly written, or are having trouble using distcc to compile mozilla because something is unclear, please leave a message in the discussion page. I appreciate any feedback (good/bad) in hopes of improving this documentation.

You do not have to leave a contact or your name.