Problems building Firefox
I’ve been building Firefox on Windows recently. Without problems. But then I wanted a build with symbols and that is when the problems started. It is meant to be simple, and it is, so long as you don’t do a
make -f client.mk clean
If you do that, then a subsequent build will fail when it comes to updater.exe.manifest.
Assuming you have downloaded and installed Mozilla build and have also installed a suitable version of Visual Studio and the latest Microsoft Web SDK, you can start the build environment by running c:\mozilla-build\start_msvc9.bat (change the number for the version of Visual Studio you are using).
Read these instructions first.
Download the appropriate source tree with a mercurial command like this:
hg clone http://hg.mozilla.org/releases/mozilla-1.9.2/ src192
I’m building on drive M: and have downloaded the source into folder src192.
Configure the build with:
echo '. $topsrcdir/browser/config/mozconfig' > mozconfig
Build the build with
make -f client.mk build
This gives you a firefox release build. Strangely the build is created without debug symbols. I don’t understand this as debug symbols are really useful even with release builds. The symbols don’t have to ship with the executable code, so there is no good reason for not creating them.
Given that you’ve downloaded the source to build the image its fair to assume that you are probably curious about the internal works or that you may be interested in modifying the source and/or writing an extension for it. Either way, you are going to want the symbols so that you can see what is happening in a debugger. Thus I don’t understand the lack of symbols by default.
You can create symbols in several ways, by adding the following lines to your mozconfig.
echo 'ac_add_options --enable-debug' >> mozconfig
echo 'export MOZ_DEBUG_SYMBOLS=1' >> mozconfig echo 'ac_add_options --enable-debugger-info-modules=yes' >> mozconfig
Getting a working build
At this point, you’ve already done a build and have created executables. Thus it seems the appropriate thing to do is a make -f client.mk clean followed by a make -f client.mk build. This won’t work. The problem is that the clean deletes the manifest files that are present in the original mercurial source download.
In the end, I wiped the whole source tree, downloaded from the source control again, modified mozconfig with the debug symbol options and did a build. That works.
This took me several attempts to understand – I thought that my various attempts at configuring the debug symbol options were breaking something, so I would change the options, clean then build. Each time takes several hours. I had this working in a virtual machine while I worked on other tasks. I probably spent about a day, including the build times before I decided to try again by starting from scratch.
I don’t know if this is true for non-Windows firefox builds, but if you want your builds to succeed don’t do a make -f client.mk clean prior to make -f client.mk build as it will prevent you from successfully building firefox.
I hope this information helps prevent you from wasting your time with this particular build problem.