My experience in becoming a FirefoxOS contributor

Back in September, I wrote that I wasn’t leaving MDN. And, I’m not, really. But, it turns out that FirefoxOS needs some help to reach its first release milestones. So, some of us webdevs from around Mozilla are temporarily switching our daily efforts over to slay bugs on Gaia. That’s the layer of FirefoxOS which provides the overall system UI and core apps.

I’m planning to return to primarily MDN work in a few months – but, right now, FirefoxOS is kind of a big deal.

Thus, like some of my other colleagues in the past month, I’ve gone from being a fully-operational battle coder on a project with which I have years of experience, to being a total noob with no idea how to find my way to “Hello world”. It’s been awhile since I last parachuted into the middle of an open source combat zone, so I fell back to my training to get my bearings:

  1. Find the docs
  2. Get the source
  3. Run the project
  4. Break something, see what happens, fix it
  5. Fix a known bug, submit a patch
  6. Try to improve the process of fixing things

Finding the docs

Oddly enough, MDN was a good place to start for docs. Though, there are FirefoxOS docs spread between MDN, GitHub, and wiki.mozilla.org. And, of course, they are each in various states of freshness and truthiness. Keep your wits about you; here be dragons.

Getting the source

Getting the source for FirefoxOS is a bit of a trick question – it depends on what you want to do, and how you want to contribute:

There are other repos, for the Gonk and Gecko layers of FirefoxOS. But, for the sake of my sanity, I’m trying to avert my eyes for now.

Running the project

If you don’t have a compatible mobile device (and few do), you need a B2G Desktop build. While it’s true that many apps will run in Firefox Nightly, and there is an emulator you can build from the b2g repo, most apps are presently problematic in Firefox Nightly, and I’ve never gotten the emulator to build successfully.

You can either build your own B2G Desktop, or download a nightly build. I’ve done both, and generally I recommend sticking with the nightly Aurora builds.

On OS X, I was able to download a nightly build and launch it with a double-click. That got things running – hooray! But, it didn’t get me productive straight away: The nightly build comes equipped with its own embedded build of Gaia, which makes it handy for trying out your own 3rd party apps but not-so-handy for hacking on Gaia itself.

To improve this situation, you need to do two things:

  1. Build your own Gaia profile from your own clone of mozilla-b2g/gaia. This is pretty much just running make or DEBUG=1 make from your git clone.
  2. Run B2G Desktop from a terminal with command line options that tell it to use your new Gaia profile, rather than the built-in.

So, at this point, I have the Gaia source and a means by which to run it on my laptop.

Breaking things

After getting the project running as intended, I break something. And by that, I mean that I change a button title somewhere to “LOL BUTTS” or intentionally introduce an exception or syntax error somewhere. Then, I fix it. This is practice that exposes me to the guts of the thing; gets me into the edit/build/run cycle; shows me what it does when something goes wrong; and pushes me toward finding the tests.

But, I think I picked the wrong week to step into the arena, because everything came pre-broken. There were semi-known bugs preventing nightly builds of B2G Desktop from running my fresh clone of Gaia. It took me most of my first week to track down those bugs in bugzilla, find workarounds, and finally get something going. And then, it all broke again. And I found workarounds again.

Eventually, I was at a point where I built my own B2G Desktop from source with a particular patch from a particular bug applied, and that got me to the point where I could submit my first pull request to fix a broken test.

Happily, things seem to have stabilized since I started: B2G Desktop nightlies have been cooperating with bleeding-edge Gaia lately, so I’ve been able to stop building my own. So, now, when I find a combination of B2G Desktop and phone and Gaia checkout that works, I cling to that for dear life until it’s absolutely necessary for me to update one of the parts.

In short, FirefoxOS is very much in flux, right now. Bring a hard hat and expect delays.

Fixing things

Once I’ve broken something and then fixed it, I usually have a sense for how to get real work done. Since then, I’ve been slowly wrapping my head around the core Calendar app, and my bug fixes have finally started trickling in.

Cobbling together a reliable Gaia-hacking workflow is complicated, though:

Room for improvement

Slowly but surely, I’ve gotten my minigun barrel spun up to start firing piles of lead bullets at Gaia bugs. But, it has been and continues to be a challenge. I’m hard-pressed to recommend it as a fun-time leisure project to anyone without a Mozilla paycheck, or even as an off-hours interest for those who live-and-breathe Firefox. This is to be expected, since it’s not even a v1.0 project yet – but, I really, really hope things improve in the not-so-distant future.

Still digging

Even with the challenges, and even if my contributions are small, I’m happy to have the opportunity to work on FirefoxOS. It’s a big deal; it’s the next Firefox. So, I plan to keep ramming my head against this stuff to help make it better, and I hope we can start taking time to make making it better better, too!

blog comments powered by Disqus
Memoirs  Previous Privacy and Social Media Next