Tuesday, December 15, 2009

"Simple" Firefox Build

A few days ago, I decided to build FireFox with my machine at home. Of course, I would not know where to approach this without being in an Open Source course. I thought it will be an easy task just like downloading the source and type 1 command asking Windows to compile, as described in this Simple FireFox Build tutorial.

Of course, Simple Firefox build does not equal to easy and fast. I had to install Win 7 SDK for Visual Studio which took a loooong time to install (a little less than 3GB installation file). In the mean while, I can simultaneously download the FireFox source code through the MozillaBuild package. At first, I didn't know how much time it will take to clone, I thought it was stuck and killed the process. (Stupid #1) When I clone it again, I thought it was stuck at the same place again, good thing I checked the size of the folder and realized the folder is growing. My gosh the FireFox source codes is 2GB of files. Both tasks together took over an hour to have them ready for the build! (BTW, my only ISP here, Rogers Communication Inc. has a monthly bandwidth of 60GB; there goes 10% of my monthly usage in 1 hour)

When I start to build and run the make file, another problem came. I tried couple of times to compile, and it returned an error. I did couple of searches for the error and they suggest that there should not be a space in between my build path. I was so sure that I didn't have a space in the path, but then suddenly, I remembered my username has a space in it. (yes I did read all instruction before downloading the MozillaBuild, Stupid #2).

Now, after fixing the path, the build process went a little bit further. This time, it says I'm trying to build for a newer platform than what the SDK version is capable of. I just downloaded the newest Win 7 SDK, why is this happening? All of the sudden, there's a Windows update icon poped up in the notification area, tell me that Visual Studio 2008 SP1 is ready to be installed. Oops, did I just assumed I have an updated Visual Studio? So I went ahead and applied the update. I read Win 7 SDK depends on Visual Studio 2008 SP1 and here comes Stupid #3. I didn't even think of retry the build before I uninstall/reinstall the SDK for the new VS. If it works even without this process, I could have saved an hour of time.

Finally, the build process looks good. It is bursting out alot of progress reports. Until it froze at one line. I wait and wait for it to move on, thinking that this file must be huge. I sat there and wait for 5 min, 10 min, 30 min, 1 hr, 2hr, 3hr!! Knowing that for a XP machine, it requires 2 hours to complete. I waited for 3 hours for that 1 line to complete thinking there must be something wrong. I finally gave up waiting and retried and it got stuck again but on another line. Of course, this time I retried the build right away. This happened about 10 times, and it finally finished building. It didn't cost 2 hours. More like 10 minutes. (Windows doesn't suck that much after all) Anyhow, my computer built the latest nightly, minefield v3.7alpre. Now that I think back the errors, it might be because the CPU is a new designed Athlon II x4, the processor might not be synchronizing its cores as the compiler wants it to.

Anyway, remember where I start? Simple Firefox Build. Simple it is, but it took me the whole night trying to figure out the cause of the errors that some of them could have been avoided if it's better documented. Like the size of Firefox source and the time it takes to build on different machines. Overall, this Firefox build experience is not a great one. But now, I can play around with the source.

1 comment:

  1. Though it was a very tiring experience but I can definitely say you have acquired ample amount of knowledge from this.I hope this works out perfectly well for you the next time.

    ReplyDelete