Build Firefox Faster with Artifact Builds

By  on  

Working on Firefox DevTools has always been a dream of mine, mostly because it feels like the ultimate way to give back to the development community and those that helped me become a success.  And when I explain who Mozilla is and people ask "Oh, so you work on Firefox?!", I can finally say "yes"!

Of course working on Firefox DevTools isn't without its problems, the biggest being that Firefox takes forever to build.  And its effect on a MacBook Pro's CPU?  Well...here's a recent photo of me building Firefox:

Build Firefox

Thankfully there's a faster way to build Firefox for local developer:  artifact builds.  Artifact builds allow you to use pre-built binaries to build Firefox for debugging DevTools (and other features) much more quickly.

Start by creating a mozconfig with the following contents:

# Automatically download and use compiled C++ components:
ac_add_options --enable-artifact-builds

# Write build artifacts to:
mk_add_options MOZ_OBJDIR=./objdir-frontend

The trigger a build using mach:

./mach clobber && ./mach build

# Use `./mach build faster` in the future

Firefox builds go from an hour (and potentially a call to the Fire Department) to just a few minutes.  If you're looking to help develop DevTools, Firefox, or simply have your own custom build of Firefox, jump on artifact builds -- these mozconfig directives are worth the time!

Recent Features

  • By
    Camera and Video Control with HTML5

    Client-side APIs on mobile and desktop devices are quickly providing the same APIs.  Of course our mobile devices got access to some of these APIs first, but those APIs are slowly making their way to the desktop.  One of those APIs is the getUserMedia API...

  • By
    6 Things You Didn’t Know About Firefox OS

    Firefox OS is all over the tech news and for good reason:  Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript.  Firefox OS has been rapidly improving...

Incredible Demos

  • By
    Creating Spacers with Flexbox

    I was one of the biggest fans of flexbox before it hit but, due to being shuffled around at Mozilla, I never had the chance to use it in any practice project; thus, flexbox still seems like a bit of a mystery to me.  This greatly...

  • By
    PHP IMDB Scraper

    It's been quite a while since I've written a PHP grabber and the itch finally got to me. This time the victim is the International Movie Database, otherwise known as IMDB. IMDB has info on every movie ever made (or so it seems). Their...

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!