Changes

Jump to: navigation, search

Building the Fox

3,243 bytes added, 10:54, 20 September 2006
m
Observations
'''WORK IN PROGRESS'''
= Aim =
To build the Mozilla Firefox browser from source code.
 
=Hypothesis=
=Apparatus=
## To close Cygwin type: exit
# Download and Extract moztools to a folder of your chosing.
# Create an batch file containing steps needed to properly configure your build environment prior to proceeding with the build. The contents of the this batch file can be found within the [[#Batch File|Batch File]] section of the [[#Appendix|Appendix]]. Make changes to the batch file as necessary to reflect the different installation paths of the various applications in question. This will ensure that all the environment variables needed for the build to succeed are properly initialized. More information relating to the specifics of this file can be found in the [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#Configure_the_Environment Configuring the Environment section] of the Windows build guide made available by the [http://developer.mozilla.org Mozilla Developer Center].
# Rename \bin\link.exe located within the Cygwin installation folder to any different name (e.g. oldlink.exe). This prevents the receipt of an error message stating that the "incremental linker version does not match the compiler suite version" as documented in the [http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites#Configure_the_Environment Configure the environment] section of the Windows Build Pre-requiste guide from the Mozilla Developer Center.
# Create the c:\proj folder to store the source and object files that will result from the checkout and build respectively.
#:* The above step creates a folder called mozilla within the proj director.
#:* Navigate to this folder by typing: cd mozilla
# Create a file named .mozconfig and place it in this c:\proj\mozilla directory. This file contains the settings The contents of the this file can be found within the [[#.mozconfig File|.mozconfig File]] section of the [[#Appendix|Appendix]]. You will notice that the last line of the .mozconfig file disables the installer thus NSIS is not required. If you omit this line then, NSIS (2.17 or greater) must be installed and its install directory (and not the 'bin' directory) added to your path.More information relating to the specifics of this file can be found in the [http://developer.mozilla.org/en/docs/Configuring_Build_Options Configuring Build Options section] of the Windows build guide made available by the [http://developer.mozilla.org Mozilla Developer Center].
# Begin source file download by issuing the following command: make -f client.mk checkout
# Once the above step is completed issue the following command to compile the source: make -f client.mk build
The next hurdle was determining how to proceed after checking out the source files using the following command<pre>make -f client.mk checkout</pre> I spent a great deal of time at this juncture trying to extract various archives of the newly downloaded source via the Cygwin command prompt in a effort to start the build. I scoured through all the folders looking for an installer or build file. The most worrying part of this excercise was that I could not find my objdir even though I explicitly specified one in my .mozconfig file (i.e. firefox-objdir). Little did I know that I needed to issue a single command to proceed to the next step: <pre>make -f client.mk build</pre> which would initiate the build. Many thanks to [[User:Elichak|Liz Chak]] for providing me with this information. However, in defense of the mozilla build documentation, I must say that it is clearly stated there (in the [http://developer.mozilla.org/en/docs/Build_and_Install#Building Building section]) and I would have seen it had I read the documentation more thoroughly and perceived that those two commands (though similar) are not one and the same.
 
 
After the build completed I tried to launch firefox.exe (located within the C:\proj\mozilla\firefox-objdir\dist\bin folder). This opened up a console window, which scrolled through various pages after page of info before displaying a NSGlue_Assertion error message similar to [[#Sample Error|sample error]] listed in the [[#Appendix|Appendix]]. After finding no results on a google search, I decided to just click ignore for this message (and the 2 that followed seconds later). The console kept scrolling and a few seconds later a GUI Firefox Brower Application Window entitle Minefield opened ! After taking the required screen shots of the Help->About page, I decided to see if I could actually browse the web. This worked with no problems. Upon closing the GUI Minefield Browser Window received a few more of the error messages mentioned above. However, after clicking ignore on all of them, the console window proceed to close. After discussing the matter with a few colleagues ([[User:Dwwoodsi|Dean Woodside]], [[User:Cbguy1|Colin Guy]], [[User:Ankuswan|Aditya Kuswanto]] and [[User:RichardChu|Richard Chu]]), we disovered that we were all receiving the same error messages during startup and exit. The messages do not appear everytime the program is opened or closed but seems to happen very irregularly. [[User:RichardChu|Richard]] believes that the problem may be related to settings in the .mozconfig file relating to debugging. He proposed that it may be the result of the presence of the "ac_add_options --enable-debug" statement or the absence of some other flag required to suppress such debug errors.
=Conclusion=
 
This was the first time I have built an open source application from source. As so, I must say the final result is very rewarding. I think the hardest part was overcoming the initial trepidation. The documentation on the process is very good provided you read and follow it carefully. I tried to attempt to answer any questions that arose by doing some research on the web. I learned that in most instances the answer was already well documented out on the web since someone out there had already encountered that problem. The [[#Sample Error|runtime debug error message]] incident is a good example of this, as I would not have known it was a common problem had I not spoken with a few colleagues about the matter. Initiative, determination, persistence and patience are also keys to the success of any endeavour and this was no different.
=Appendix=
ac_add_options --disable-installer
====Screenshots=========Help->About=====[[Image:Sherman_DPS909_Asg1_About.PNG | Firefox 3.0a1 Help > About screenshot]]=====Sample Error=====[[Image:Sherman_DPS909_Asg1_Error.PNG| Firefox 3.0a1 Sample Error]] =References& Acknowledgements=*[http://developer.mozilla.org Mozilla Developer Center], Windows [http://developer.mozilla.org/en/docs/Build_Documentation Build Documentation]<br />*[[User:David.humphrey|Humphrey, David]]- [http://cs.senecac.on.ca/~david.humphrey/writing/firefox-win32-build.html Building Firefox on Win32]<br />*[[User:Elichak|Chak, Liz]]- For realizing that the source of the initial confusion was the fact the fact that I missed perhaps most important command of all during the build process. i.e. make -f client.mk build.*[[User:RichardChu|Chu, Richard]], [[User:Cbguy1|Guy, Colin]], [[User:Ankuswan|Kuswanto, Aditya]] and [[User:Dwwoodsi|Woodside, Dean]] for alerting me other to the fact that they too received the runtime [[#Sample Error|NSGlue Assertion debug errors]].
1
edit

Navigation menu