Notes on Firefox development

27 June, 2011 § 2 Comments

Today marks the start of my third week at Mozilla. I’d like to mark this occasion with some things that I have learned that are pertinent to developing for Firefox.

  1. review?

    When I submitted my first patch to Mozilla, I added a reviewer by appending r=reviewer to my patch. While this may say what you mean, it doesn’t do what you mean.

    To properly request a review, set review to ? in Bugzilla when you are adding an attachment. This will properly email the reviewer so they can become aware of the request.

  2. make -s -C objdir

    Running a clean build of Firefox can take about 25-30 minutes, while an incremental build can still take about 2 minutes. This is clearly not conducive to an iterative-style of coding.

    To make builds faster, you only need to rebuild the parts that have changed. To do this, simply run make -s -C objdir, where objdir is the parent directory within the object directory of the code that you have changed. It may be necessary to also re-link if native code has changed.

  3. -moz-appearance: none

    This was the first XUL gotcha that I ran into. I bumped in to this as I was working on bug 598169 and trying to make a XUL:textbox styleable.

    Many XUL elements use OS-dependent styling, and if you want to apply styles to them then you will have to turn off the default styling. -moz-apperance: none does just that.

  4. hg qpush –move patch

    Many of the developers at Mozilla use the mq extension for Mercurial. mq is a tool that allows you to keep all of your changesets in separate queues. This makes it easier to work on different patches in parallel.

    Most work can be done with three of the mq commands: hg qnew, hg qpush, and hg qpop.

    A normal hg qpush patch will push the current patch as well as all preceding patches on the tip, whereas hg qpush --move patch allows a user to push just the single patch on the tip.

  5. pymake

    If you’re working on Windows, Firefox can take a while to build when using the standard make -f client.mk. Fortunately, there exists a tool that makes your builds run a lot faster by taking advantage of the multiple cores on your system.

    Running python -O "..\build\pymake\make.py" -s -j12 will build Firefox with 12 concurrent compilations. I chose 12 because it is 1.5x the number of threads on my system. :dolske ran some benchmarks to find the optimal -j setting and advised me on the 1.5x multiplier.

    You can learn more about pymake on the Mozilla development website.

Tagged: , , , ,

§ 2 Responses to Notes on Firefox development

  • A.J. says:

    Hey Hey Jared! These are all great tips! I just install a Firefox beta (version 6) yesterday! I didn’t build from source though; so I didn’t make the executable. My update was already set to the beta repository; so I simply issued the command: zypper install MozillaFirefox

    • msujaws says:

      Great news! Firefox builds the fastest on Linux (about 10-15 minutes on a good computer). I’ll try to get you setup to build Firefox when I’m in town ;)

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

What’s this?

You are currently reading Notes on Firefox development at JAWS.

meta

Follow

Get every new post delivered to your Inbox.

Join 1,013 other followers