Open main menu

CDOT Wiki β

Dwwoodsi assignment 1

Revision as of 23:28, 20 September 2006 by Dwwoodsi (talk | contribs) (Steps to Build)

Plan

Though I started late, I maintained that I didn't want to use the work of others if only for the reason that I could see how difficult it was to build Firefox from scratch.


In addition, my plan was to build on my FreeBSD machine as I thought it would be easier (given I already had many of the required tools installed). After building it on a single machine, I wanted to setup distcc and give it a go with a distccKnoppix live distro running on the other machines in the house.After browsing the documentation (outlined in the Steps to Build section), I reconsidered. I was pressed for time and realized that should I encounter difficulties, most help I could find would be towards GNU/Linux.


I have had very limited exposure to GNU/Linux save for some juvenile adventures with Slackware, an older laptop and Kismet in my younger days ;) The GNU/Linux binary support (if I needed to use it) on FreeBSD had its own share of problems, too (I encountered difficulties in the past). So I decided against my first plan and went with a Win32 build instead. This would turn out to be a good decision.

Machinery Used

1.67 GHz Palomino-class Athlon w/ 1024MB RAM (FreeBSD 5.5-Rel)

1.33 GHz Thunderbird-class Athlon w/ 512MB RAM (Windows XP)

Software Installed

I had Visual Studio 2005 installed.

Cygwin Selected additional packages:

  • patchutils
  • perl
  • zip, unzip

Downloaded make 3.80 from the web.

Downloaded and extracted moztools using the built-in zip tool.

Installed NSIS (didn't need it the end).

Steps to Build

Knowing that documentation and links were already available from others, I still went ahead and approached the assignment as though I didn't have them available to me. I wasn't completely immune to the influence of others, though. I recall Sherman telling me that "the documentation provided everything, IFF you read it" (paraphrase).

1. Searched for "mozilla developers" and came upon the [1] website (first Google result).

2. Scrolled the page, found [2] link.

3. Installed Cygwin with additional, non-default packages selected (patchutils, perl, zip, unzip). Chose c:\cygwin\ as the directory.

4. Opened Cygwin environment.

5. Downloaded and installed make 3.80.

bunzip2 make-3.80-1.tar.bz2
tar xvf make-3.80-1.tar

In retrospect, could have used tar -xvjf for one fell swoop (only I didn't know the flag for bzip2 compression until reviewing this and searching) 6. Copied make from usr\bin to c:\cygwin\bin

7. Downloaded the moztools package. Extracted to c:\seneca\fall2006\dps909\moztools\.

8. Under the CVS heading, clicked the link for pulling the source from CVS [3]).

9. Read the page in entirety before going forward.

10. Checked Tinderbox for the Firefox Tree ([4]). All clear for go.

11. Pulled tree for Firefox.

cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk
cd mozilla
make -f client.mk checkout MOZ_CO_PROJECT=browser

12. Downloaded and installed NSIS (but didn't need it, later on).

13. Made a batch script by modding the one provided on the [5]:

set HOME=C:\home
set VCVARS=C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat
set MOZ_TOOLS=C:\seneca\fall2006\dps909\moztools
set CYGWINBASE=C:\cygwin
set CYGWIN=nodosfilewarning
set PATH=%CYGWINBASE%\bin;%PATH%
call "%VCVARS%"
set PATH=%PATH%;%MOZ_TOOLS%\bin
set PATH=%PATH%;"C:\Program Files\NSIS"
bash --login -i

Note that I removed the MSSDK portions.

12. Ran batch script.

13. Scratched head and searched page for awhile. I wasted about 30 minutes trying to find out what to do next. Finally found the not-so-pronounced [6] and [7] links at the top.

14. Made the following .mozconfig configuration file:

. $topsrcdir/browser/config/mozconfig
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-objdir
ac_add_options --disable-static --enable-shared
ac_add_options --enable-debug

The last option: tried variations with debug and level-2 optimization (O2).

15. Build source

make -f client.mk build

16. Found binary under C:\seneca\fall2006\dps909\mozilla\firefox-objdir\dist\bin.

Problems Encountered

First, I'd have to say that my lack of familiarity with the Mozilla Wiki theme had me completely overlook the additional links at the top for Build and Install instructions along with how to Configure Build Options. I probably passed this off as a table of contents or something. I looked up and down the page for 30 minutes (on and off, with some other tasks opened) before noticing them

Second, I tried building with level-2 optimization but canned that after a few minutes as it started to hang (I think it might not have hanged, but rather just been optimizing a little too much...?) anyways I went with debug mode. Afterwards, upon launching the binary, I encountered lots of debug errors which Richard Chu later told me were appropriate and to be expected.

After building on Win32, I gave my FreeBSD machine a try. The build barfed on the makefile, probably because I attempted in C shell ;) Whatever it was, I didn't have a chance to look into it as I had to get to school for class. It may have been that simple, but then again I may have encountered more difficulties later...perhaps I'll try it (someday).

How I Solved Said Problems

1) Spent time looking around for further instruction. 2) Wasn't a problem per se. Rather reassurance from classmate to clarify something. Sherman brought it up with Colin and Richard. 3) Ran from problem ;)

Resources Used

  • Google [8]
  • MDC - Windows Build Prerequisites [9]
  • MDC - Configuring Build Options [10]
  • MDC - Build and Install [11]
  • Richard Chu - Confirmed the debugging errors
  • Sherman Fernandes - Told me that the process was all within the documentation ;)
  • Colin Guy - Confirmed he encountered debugging errors, too

Screenshot

 

Conclusions and Reflections

Overall a reasonably short and straightforward process. I delayed the process because I had heard how others encountered lots of problems and/or their binary didn't work appropriately. I didn't learn much, but that is my own doing. I didn't pick apart the makefile to see what was going on. The documentation on the Mozilla site was good enough for "How" but not "Why"; I failed to find out what was going on and more intricate details that would have been nice. Even if I -had- mucked around the makefile and watched some of the build output, I would be left not knowing much more. Perhaps some documentation could be written detailing what happens with such a large project. Perhaps it exists. I'm not overly interested, just making note...