Colorize that build!

If you’ve ever built Mozilla from source or run the unit tests, you’ll know that doing so can generate a lot of console output. When errors happen, it can take a bit of scrolling to figure out exactly what failed, and where. I recently switched to pymake (because it’s sooo much faster), and it generates even more output.

Recently Shawn mentioned he had some magic pixie dust to colorize build output (which I didn’t know was possible on Windows), and I extended what he had to do a bit more. I’m finding it hugely useful, so figured I should share!

First, the pretty picture. This particular example is a bit gaudy, but shows a lot of what it does. The mostly useless nsinstall output (of which there’s a *lot*) is dark blue. Compiler warnings are yellow, errors are red.

Oh, and xpcshell tests benefit too!

To add this to your Windows MozillaBuild environment, just add this stuff to ~/.profile, and then open a new shell window.

There’s probably a lot more that could be done with this (and I’m sure it missed all kinds of interesting cases), but it’s a good, simple start!

Advertisements

Handy trick

If you’re involved with developing on Mozilla, odds are you’ve got at least one or two (dozen? 🙂 profiles for testing. Some used regularly, some created-and-forgotten for one-off testing, some you’ve forgotten what they’re for. And you probably jump through gymnastics with the Profile Manager to create, select, and delete said profiles.

Once upon a time I used to do the same thing, until someone pointed out that there’s a different way to create and select profiles.

Old And Busted:

1) run firefox -P
2) Create new profile
3) Click, click, typeity, click
4) Select new profile
5) Swear, run firefox -P again because you didn’t mean to set that as your default
6) What was I doing again?
7) Oh yeah, test that thing. Quit.
8) run firefox -P
9) Delete profile
10) Lather, rinse, repeat for repeating testing with a clean new profile.

New Hotness:

1) mkdir /tmp/blah (or ~/profiles/blah for more permanence)
2) firefox -profile /tmp/blah
3) rm -rf /tmp/blah

At least for my workflow, I haven’t used the Profile Manager since. (This trick doesn’t depend on Profile Manager at all, so even it was removed at some point this would still work.) Some folks might prefer the Profile Manger for their needs, but this works great for me.