I walked through the Minefield … and built Mozilla Firefox 3.1b1pre

Minefield 3.1b1pre

Minefield 3.1b1pre

I walked through the Minefield… and built Mozilla Firefox 3.1b1pre

So watch your head rock… 🙂

What does this mean? A whole lot of reading, learning and embracing the unknown.

The objective was simple, download Mozilla Source Code from Mozilla-Central.Weapon of choice? The Operating System you choose to build Firefox on. Ultimately, due in reason to the fact that steps differ but the common idea and objective is the same. You need a hammer to drive the nail in the floor-board, or rather, you need the proper tools to setup an environment and build Mozilla Firefox.

My weapon of choice for tonight was Ubuntu 8.04 (Hardy Heron)

Let me just say straight off the bat. I am really surprised at the lack of problems I had. I did not rush, I spent about an hour and a half before hand reading each link posted here.

I could not get the Paul Reed or Robert Helmer videos to play with Totem in Ubuntu (I’m delegating this to a Quicktime/MOV issue) but I did indeed watch Ted Mielczarek video on Mozilla’s Build System, ofering me a reminder of the make program which I have not used since OOP244, a C++ course back in my previous program at Seneca College. It was also nice to put a face to the nickname ted in the IRC chatroom (#seneca@mozilla.org).

On to the build process..

I had a notion that building Firefox on Ubuntu or any flavor of Linux would be a heck of a lot easier than building on Windows due to access to number of commands and programs already installed and setup with the distribution, thus the reason for selecting Linux to build it on.

Like a freshman listening to a senior professor, I was confused at all these new terms being thrown around, but I am very quick learner and made sense of it all. Some of the new terms include:

  • gnu-make
  • MXR
  • Tinderbox
  • Branch
  • NSPR
  • Rules.MK
  • Buildbot – (Domi arigato, Mr Roboto?)

… and so I scoured the Mozilla domain and found answers; adding MXR to my bookmarks for obvious reasons, and found out what Buildbot is (A system to automate the compile/test cycle required by most software projects to validate code changes).

With my fork and knife in my hands, I had the tools ready to dig in. I downloaded and setup Mercurial and properly followed the ~/.hgrc setup preconditions. Connected to Mozilla-Central and cloned the repositories to my ~/Desktop.

With the source, I was now able to properly setup a ~/.mozconfig file (detailing any specific instruction you want the browser to be compiled with)

make -f client.mk build

.. and voila

<insert 45 minutes worth of compiling messages>

Firefox runs, it works, it’s alive… it’s alive

I have never built Firefox or any large application before (size of source folder unpacked is a gig) and found this lab very interesting as you have to embrace installing software/libraries and packages you’ve never heard of before in order to compile Mozilla software. For example, I have no idea what the dbus-1-glib-devel (Developer package for D-Bus/GLib bindings) is and why its required in order to build Firefox. I had heard of CVS and subversion but wanted to try out the new technology of Mercurial.

In essence, you have to close your eyes, plug your nose and jump into the world of the unknown … you have to read things twice, maybe three times in order to understand, ask for help in IRC, search newsgroups or ask someone who knows. I listened to the online lectures and read Mozilla documentation, it’s there for a reason. Results? 0 problems during the build process.

Overall, I did not have any problems getting Firefox Minefield 3.1b1pre up and running and the entire process did not take too long. I have a hunch that executing these tasks on Win32 will take longer due to the fact that you have to setup Cygwin and other utilities for VC9 (Visual Studio 2008) in order to get the snowball rolling.

I’m left with one question at the top of my head right now that maybe through comment someone can answer me. If you make a small change in Firefox, do you need to recompile the entire application, or is it modular?

PS: If anyone needs help with building in Ubuntu, send me a shout on IRC.


AaronMT (Aaron).


One response to this post.

  1. Once you do a full top-level build (sometimes know as a client.mk build, or a clobber build), you can then do incremental builds to only rebuild portions of the tree that are affected by your changes. We’ll learn how to do this soon.

    Good work.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: