DEV Community

Aniket Kadam
Aniket Kadam

Posted on • Originally published at Medium on

First commits to world-spanning projects, part 1

An experience contributing to the Mozilla codebase!

My first commit to Firefox was inevitable. There are a usually lot of ethical minefields in developing software. Firefox is one project that stands out in being a real visible force for good.

Once I worked on large scale projects that at least are being seen by a few thousand people, it’s really hard to go to simple ones.

So here’s what was involved in doing it.

Step 0

Google “contribute to Firefox”, that leads you to the super helpful page here.

Get the source code!

The first challenge a large scale project poses, is in simply getting all the code to your machine. I’m from a developing country and Internet isn’t great here.

Firefox, is a monorepo (all the code for everything is in one repo) and in any case there’s quite a bit of shared code. The straightforward instructions will tell you to clone and go have a coffee while you do it.

This is straight up impossible on most third world internet connections. Clones don’t resume if there’s a break in your net and tend to be sensitive to timeouts. Luckily, mozilla already has the solution for you, to download a bundle that’s a compressed version of a clone. This can be treated like a normal file, is smaller and can be resumed.

Queue up the build requirements too!

The last thing you want to do after waiting a few hours to get your 1.4Gb bundle, is to now wait to get several GB more of the other tools you need.

In my case I was developing for android and didn’t have the ndk, so that needed to be started up.

Do a build

Now that you have the source code, the next thing to do is to try building it as it is. This will help ensure a baseline you work off.

Run into issues

In my case, I ran into a problem right away. I hopped onto the mozilla irc to ask about it. Where the person who was very involved in the build system nalexander on the irc, responded to me.

It was a known bug in some configurations and they had a workaround.

Fix the issue for yourself ( therefore everyone )

I have extensive experience in baroque build systems. Having created one for a cross platform app generating product myself. I pinpointed the issue, verified the fix works, investigated a bit why it didn’t work originally. Since it turned out to be a Google bug that’s fixed but not deployed yet.

You have to be very careful in saying to someone ‘The bug is on your side’. You pretty much need a failing test case because otherwise, a: You might be wrong, b: You’re not contributing to the fix. c: You might still be wrong but now you need to communicate to find out!

The workaround was straightford. So, first talk about if there’s an even more straightforward way! Back to IRC to discuss.

After a bit more conversation, and few more tries, and the classic running into other issues that were only on your side, days later, I had a fix ready.

In my next post, part 2, I’ll go a bit more into what to do now that you have a fix ready!

Top comments (0)