Changes

Jump to: navigation, search

Eva Assignment 1

11,374 bytes removed, 21:39, 19 September 2006
no edit summary
=Configuration=
Here are the steps that I took to configure the environment for the Firefox build:==Configure the environment==# Make a directory for the source and build system:<pre>$mkdir C:\proj</pre># Make a directory called <b>moztools</b> in <b>C:\proj\</b> # Download and extract the My configuration process is following what Liz Chak []has on her documentation [http://ftpcs1.mozillasenecac.org/pub/mozillaon.orgca/mozillawiki/libraries/win32/moztools-staticindex.zip static moztools libraries for Visual C++] to <b>C:\proj\moztools<php/b>Liz_Chak_Assignment_1# To setup the appropriate environment variables and paths, create a build script called <b>buildsetup.bat</b> in <b>C:\proj</b>. Copy and paste the following script into buildsetup.bat:<pre>@echo off rem --- CVS SetupSET CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsrootSET CVS_RSH=ssh rem --- Setup the paths to Configure_the_environment] for the moztools build librariesset MOZ_TOOLS=C:\proj\moztoolsset GLIB_PREFIX=%MOZ_TOOLS%set LIBIDL_PREFIX=%MOZ_TOOLS% rem --- Scrub these variables firstSET INCLUDE=SET LIB=SET PATH=C:\;C:\windows\system32;C:\windows\system32\wbem rem --- Prepend cygwinSET PATH=C:\cygwin\bin;%PATH% rem --- Setup VC8 compiler environment varsCALL "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86 rem --- Add glib/libidl to build environmentSET PATH=%PATH%;%GLIB_PREFIX%;%GLIB_PREFIX%\binSET INCLUDE=%GLIB_PREFIX%\include;%INCLUDE%SET LIB=%GLIB_PREFIX%\lib;%LIB% rem --- moztools comes last after glib/libIDLSET PATH=%PATH%;%MOZ_TOOLS%\bin</pre>  &nbsp;&nbsp;&nbsp;&nbsp;5.&nbsp;&nbsp;Run the <b>buildsetup.bat</b> script in <b>C:\proj</b>:<pre>$buildsetup.bat</pre>*To check which program you're running, type <b>which link</b> in the command line after you run the environment variable script (buildsetup.bat) and it will tell you the link: <pre>$which link$/cygdrive/c/Program Files/Microsfot Visual Studio 8/VC/BIN/link</pre>*It will be the cygwin or Microsoft link depending on which one you set in the <b>buildsetup.bat</b> 
==Check out mozilla source==
#Login to the mozilla CVS repository in <b>C:\proj</b>: <pre>$cvs login</pre>#Type in <b>anonymous</b> Same as the password when prompted (NOTE: ignore the error message related to .cvspass)#Checkout the build script in <b>C:\proj\</b><pre>$cvs co mozilla/browser/config mozilla/client.mk</pre>#* A <b>C:\proj\mozilla</b> directory is created.#* It takes awhile for the source to get downloaded. Be patient. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.&nbsp;&nbsp;After source is downloaded successfully, create a text file with the filename <b>.mozconfig</b> (filename should be exactly how it's spelt: .mozconfig) in the editor of your preference in <b>C:\proj\mozilla</b><pre># Building Firefox Trunk with Debugging. $topsrcdir/browser/config/mozconfig # Put all obj files in one place, not in src treemk_add_options MOZ_OBJDIR=@TOPSRCDIR@/firefox-objdirac_add_options --disable-staticac_add_options --enable-shared # Debug Build Setup Optionsac_add_options --disable-optimizeac_add_options --enable-debug # I'm using Canvas for my workac_add_options --enable-canvas # I disabled the installerac_add_options --disable-installer</pre> *Note that I have disabled static build, meaning my Firefox will build dynamically: <pre>ac_add_options --disable-static</pre> A static build is one that doesn't need external libraries to run. To run a build dynamically, you require all the development libraries and so on installed. A static build takes more time than a dynamic build. *Note that I have disabled installer to avoid a [[Liz_Chak_Assignment_1#Problem:_.22To_build_the_installer_makensis_is_required_in_your_path.22_error|problem]] later: <pre>ac_add_options --disable-installer</pre>  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5.&nbsp;&nbsp;Get the full source from CVS (By default, you will build HEAD, which is Firefox 3.0):<pre>$cd \proj\mozilla$make -f client.mk checkout</pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.&nbsp;&nbsp;Build the source in <b>C:\proj\mozilla</b> <pre>$make -f client.mk build</pre> The time it takes to build Firefox depends on your machine. It could take as little as 16 minutes or as long as 3 hours! Just be patient and a miracle will happen (unless the console spurts out error code - refer to my list of [[Liz_Chak_Assignment_1#Problems_and_Solutions|problems]] if you encounter any, hopefully it helps). Your newly built monster, I mean, Firefox will be in <b>C:\proj\mozilla\firefox-objdir\dist\bin</b>. Double click on the executable file that looks like a minefield (and cross your fingers to hope that it wouldn't crash your system). =My first failed attempt to build Firefox 1.8.1=After glancing through the [http://developer.mozilla.org/en/docs/Build_Documentation Mozilla Build Documentation], I only needed one word to describe how I felt, overwhelmed! I started by skimming through the text, and downloaded all the required tools, configured the environment, checked out the source before I started my build. I ran into the problem: <b>The linker major version does not match the compiler suite version7</b> Without researching further on the problem, I consulted one of my classmates and he said that I had to re-install Visual Studio 2003. I was skeptical about his way of resolving this problem (and also it would be a hassle since I've uninstalled it a week before this build), so I looked into it further and found out from [http://forums.mozillazine.org/viewtopic.php?t=438157&sid=03462713fcf201b52e92791b2c65d14f Mozillazine] that the solution is to install CygwinLiz Chak documentationI tried a new clean build with [http://cscs1.senecac.on.ca/%7Edavid.humphreywiki/writing/firefox-win32-build.html David Humphrey's Guide to Building Firefox on Win32 using Visual Studio .NET 2005] (very concise and recommended for the heroes who want to build Firefox).  =Problems and Solutions===Problem: "To build the installer makensis is required in your path" error== The very first problem I encountered after I started to build took me merely a couple minutes to solve thanks to my great old friend [http://www.google.com Google]. The command prompt spurted out this error message: <pre>checking for makensis... noconfigure: error: To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.</pre> ==Solution: "To build the installer makensis is required in your path" error== I found my solution on a forum, [http://forums.mozillazine.org/viewtopicindex.php?t=92495&start=1320&sid=ad7fac8c3bc80a7373a0bf8957a15971 Mozillazine]. Basically I just added "ac_add_options --disable-installer" to my <b>.mozconfig</b> file.  ==Problem: "target `c' doesn't match the target pattern" error== The next problem I encountered was a little trickier. The error code was: <pre>../coreconf/rules.mk:365: target `c' doesn't match the target pattern../coreconf/rules.mk:406: target `c' doesn't match the target pattern../coreconf/rules.mk:407: warning: overriding commands for target `c'../coreconf/rules.mk:366: warning: ignoring old commands for target `c'../coreconf/rules.mk:437: target `c' doesn't match the target pattern../coreconf/rules.mk:438: warning: overriding commands for target `c'../coreconf/rules.mk:407: warning: ignoring old commands for target `c'../coreconf/rules.mk:445: target `c' doesn't match the target pattern../coreconf/rules.mk:446: warning: overriding commands for target `c../coreconf/rules.mk:438: warning: ignoring old commands for target `c'../coreconf/rules.mk:449: target `c' doesn't match the target pattern../coreconf/rules.mk:450: warning: overriding commands for target `c'../coreconf/rules.mk:446: warning: ignoring old commands for target `c'../coreconf/rules.mk:464: target `c' doesn't match the target pattern../coreconf/rules.mk:465: warning: overriding commands for target `c'../coreconf/rules.mk:450: warning: ignoring old commands for target `c'../coreconf/rules.mk:468: target `c' doesn't match the target pattern../coreconf/rules.mk:469: warning: overriding commands for target `c'../coreconf/rules.mk:465: warning: ignoring old commands for target `c'../coreconf/rules.mk:966: *** multiple target patterns. Stop.</pre> My typical solution to any problems is "consulting" my old friend [http://www.google.com Google]. It seemed like quite a few people encountered the same problem. I found out from a forum that the problem was that I didn't have the right version of Make. I had Make 3.81 which should have been Make 3.80. I pulled up the [http://developer.mozilla.org/en/docs/Windows_Build_PrerequisitesLiz_Chak_Assignment_1#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 GNU Tools for Microsoft Windows (Cygwin)Check_out_mozilla_source] installation guide again, and realized that I have missed out the part where it mentioned <b>make 3.80 (not 3.81!) -- dependency analyzer for software builds (Devel category)</b> as one of the required packages. <b>However, when I reinstalled Cygwin again, it didn't give me an option to choose Make 3.80!! </b> <b>[http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 Windows Build Documentation is updated - 17:15, Sept 16 2006 (EST)]</b> I tried various solutions (hunted for an older version of Cygwin to install and linking Make 3.80 from Cygwin with ln -s command) but my build still failed. It was frustrating, because through most of the forums that discussed about this problem, it seemed like everyone didn't have a problem "rolling back to version 3.80". However, the version of Cygwin that I installed didn't have the older version of Make and I wasn't the only person experiencing that problem at that time. Both my classmate and I tried the various solutions as per my suggestions but they all failed. After several unsuccessful attempts, I consulted [[User:Sancus|Sancus (Andrei Hajdukewycz)]] for a solution (which was easier than I thought), and the miracle happened, Firefox was then successfully built!! (Sheds a tear of joy..) ==Solution to "target `c' doesn't match the target pattern" error==*Install Cywgin from [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#GNU_Tools_for_Microsoft_Windows_.28Cygwin.29 here]*Download [http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2 Make 3.80] (Make sure the existing version on your system is cleanly removed all else there will be version conflicts)*Extract it and install it*As it is a binary package, you could just grab the Make executable file (make.exe) from <b>/usr/bin/</b> and drop it in <b>cywgin/bin</b> (this will overwrite the existing Make executable)*Double check if you have the right Make package by typing this command (change to the directory <b>cywgin/bin</b>):<pre>$ make -vGNU Make 3.80</pre>
<i>Voila!</i>
=Problems Encountered=I also learned from [[User:Sancus|Sancus]] that you can dump did not encounter any problem during the Make package in your Cygwin packages temp directory build, because Liz Chak instruction is very clear, I follow every step and the installer will let you install I got thru it without a single problem. I know it (is not too good for my experience, but then at least I didn't actually try that). The mirrors don't seem to have properly set up setup.hint files to point to the old versions of the Make filescan follow instruction.
==Miscellaneous The major problems and solutions==I have encountered an error code when I tried are prior to build <b>without double-checking if I check-marked all the packages required set up. Mostly related to hardware and Windows installation issues. At first, my 80GB was partitioned this way. 10GB for running Windows XP, 20GB for entertainment files, 30GB for school files, the Firefox build during my Cygwin installation</b>rest is still waiting for use. This problem will also occur if you are installing an older version I thought I can just free up the 20GB and the rest of the spaces to install a new piece of Cygwin which Windows, but it doesn't work that way. I need to free them all up to have all a bigger partition again. Hence, I guess I learned a lesson not to partition too less spaces for my drive. Also, need to back up the school files in the packages required for 30GB first, because I do not want to lose the Firefox buildSchool files. Here I did not have a empty CD-R or DVD-R on hand, the only thing I have is a sample of new 160GB harddrive, so it took me a while to figure out why I could ont run my harddrive at the error code:<pre>make[2]: Entering directory same time. Mainly because I didn'/cygdrive/c/proj/mozilla/firefox-objdir/config't make[3]: Entering directory '/cygdrive/c/proj/mozilla/firefox-objdir/config/mkdepend'make[3]: Leaving directory '/cygdrive/c/proj/mozilla/firefox-objdir/config/mkdepend'/usr/bin/perl -the drive a master and a slave. I/cygdrive/c/proj/mozilla/config /cygdrive/c/proj/mozilla/config/bdatefinally figured that out and start Windows installation.pl build_numbermake[2]: *** [build_number] Error 255make[2]: Leaving directory '/cygdrive/c/proj/mozilla/firefox-objdir/config'make[1]: *** [default] Error 2make[1]: Leaving directory '/cygdrive/c/proj/mozilla/firefox-objdir'make: *** [build] Error 2</pre>
Another problem that I believe encountered was installing VS .NET 2005. As I mentioned earlier, the problem was not having Windows Updated to Service Pack too, plus using WINRAR to extract the ISO instead of Daemon. To fix this error occurred because problem is not hard, just very time consuming, you probably need to give a whole night to do the Windows Updated until it get the Service Pack 2 update done. My solution to the WINRAR problem is to uninstalled the Make build tool couldn't find WINRAR and using Daemon only to mount the Perl packageISO file.
The following is a screen shot of "About Minefield" (Help -> About Minefield):
[[Image:Liz_minefieldeva_minefield.jpg]]
=Contributors=
 
[[User:Sancus|Andrei Hajdukewycz]] (sancus)
: Helped me with placing Make 3.80 in Cygwin
[[User:David.humphrey|Dave Humphrey]] (dave)
: Well-documented and concise: [http://cs.senecac.on.ca/%7Edavid.humphrey/writing/firefox-win32-build.html David Humphrey's Guide to Building Firefox on Win32 using Visual Studio .NET 2005]
[[User:djhamp-gElichak|David Hamp-GonsalvesLiz Chak]] (inveigleelichak): Head start with Excellent documentation help me aids the build in very short time<b>first</b> attempt to build Firefox! =Resources=I wouldn't have successfully built without the following documentations:*[http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites Windows Build Prerequisites]*[http://cs.senecac.on.ca/%7Edavid.humphrey/writing/firefox-win32-build.html David Humphrey's Guide to Building Firefox on Win32 using Visual Studio .NET 2005]*[http://forums.mozillazine.org/viewtopic.php?t=92495&start=1320&sid=ad7fac8c3bc80a7373a0bf8957a15971 Mozillazine]*[http://cs.nyu.edu/rgrimm/teaching/fa05-oop/windows-make.html Getting Make to place nice with Cygwin]* [http://acs.senecac.on.ca ACS]* [http://www.cygwin.com Cygwin]* [http://developer.mozilla.org/ Mozilla Developer Center]* [http://developer.mozilla.org/en/docs/Build_Documentation Mozilla Build Documentation]  If it wasn't for the following people, I wouldn't have my great Firefox built:*Special thanks to [[User:Sancus|Andrei Hajdukewycz]] for guiding me through the most difficult part of the build process and helping me have a little more understanding of the Firefox build!!*[[User:David.humphrey|Dave Humphrey]]: Thanks for transferring your Firefox build knowledge. It definitely a great summary to the [http://developer.mozilla.org/en/docs/Build_Documentation Mozilla Build Documentation]. 
=Conclusion=
1
edit

Navigation menu