Revision 140722 of Mozilla Source Code Directory Structure

  • Revision slug: Talk:Mozilla_Source_Code_Directory_Structure
  • Revision title: Mozilla Source Code Directory Structure
  • Revision id: 140722
  • Created:
  • Creator: TylerD
  • Is current revision? Yes
  • Comment 1 words added

Revision Content

Update

As some of you may have noticed, this page is gradually getting out of date. With old refrences to LXR (I removed that to MXR) and to CVS, as well as unwritten sections, it would be nice to get this page up to date. It is more important with bug 471144 coming into the trunk, which will move many old readmes to this page and a link to here is planned to be put into the root readme for mozilla-central. TylerD 02 January 2009

Misc

IMO, this should be replaced with , which is both more accurate and easier to scan/read. --Nickolay 03:32, 27 December 2005 (PST)

No one should be using client.mk to pull the sources. So no, until the cvs repository is actually broken into pieces, there should be a page to cover the whole CVS repository. Jeff Carr 14:10, 27 December 2005 (PST)

client.mk is the only supported way of pulling the source to build any of the client apps. I'm not sure what you mean by "nobody should be..." -David Baron 16:29, 27 December 2005 (PST)

Those are the most confusing instructions ever. I screwed around on that page once before and gave up (the cvs instructions page). It suspect it didnt' help anyone else either. Note the only other comment put on that page was: can you please just put the cvs command to check this out. Make things simple:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot checkout -P mozilla

Can you please explain why the above will not work? That's how I've checked out mozilla. I proceeded with:

./configure --enable-application=browser
make
./dist/bin/firefox

Things seem fine to me. It's finally built. I don't understand why I had to screw around for 2 days to grok out these 4 commands. Thanks for your patience. I'm sure you will agree that it is useful to have streamlined instructions for new developers that are volunteers -- specifically instructions that save them as much time as possible :)

Jeff Carr 18:34, 27 December 2005 (PST)

You are getting NSPR and NSS from the wrong branch (namely, HEAD). Mozilla normally uses a special branch of them. But yeah... it will usually work; fortunately NSPR/NSS care a lot about API compat.

However, I do want to note that the two commands that client.mk requires:

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

aren't much more complicated.

--biesi 18:53, 27 December 2005 (PST)

And above of that, listed on Mozilla Source Code Via CVS already for a long time ago ;) Andreas Wuest 19:01, 27 December 2005 (PST)

Nice Page

Thanks for updating this page and moving it into the wiki. It's very helpful. Now onto the thunderbird sources... Jeff Carr 18:52, 27 December 2005 (PST)

"Quick and easy linux build instructions" page proposal

OK, if I have this right then, the correct instructions for firefox can be reduced to:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot checkout mozilla/client.mk
make -f mozilla/client.mk checkout MOZ_CO_PROJECT=all
./configure --enable-application=browser
make
export LD_LIBRARY_PATH=`pwd`/dist/lib; ./dist/bin/firefox

or for thunderbird:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot checkout mozilla/client.mk
make -f mozilla/client.mk checkout MOZ_CO_PROJECT=all
./configure --enable-application=browser
make
export LD_LIBRARY_PATH=`pwd`/dist/lib; ./dist/bin/thunderbird-bin

If that is ok with everyone, then I think it would be really useful to have this as a page to simplify getting poeple up and running quickly.

Thanks, Jeff Carr 17:07, 28 December 2005 (PST)

There's a "cd mozilla" missing somewhere, and why are you setting LD_LIBRARY_PATH? --biesi 17:55, 28 December 2005 (PST)
Oh, more things... Don't run the -bin binaries directly, use the scripts without them, so ./dist/bin/thunderbird. Also, don't use =browser if you want to build thunderbird. --biesi 17:56, 28 December 2005 (PST)
Nope. An example for ckecking out Firefox from branch HEAD and building it would be:
$ cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot login
(type the password "anonymous")
$ cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk
$ cd mozilla
$ make -f client.mk checkout MOZ_CO_PROJECT=browser
$ make -f client.mk build
It's all already on Mozilla Source Code Via CVS and Build and Install. Is it really that hard to figure that out? Andreas Wuest 17:25, 28 December 2005 (PST)
login isn't needed. the instructions above seem fine to me, except for that LD_LIBRARY_PATH thing... --biesi 17:55, 28 December 2005 (PST)
Which instructions are you referring to now? Mine or Jeff Carr's? Login may not be needed, but running configure by hand, setting LD_LIBRARY_PATH and running *-bin directly is plain BS. It is all documented, just go and read Build Documentation, Mozilla Source Code Via CVS and Build and Install. What is so hard about reading these days? -- Andreas Wuest 18:04, 28 December 2005 (PST)
Running configure is fine. But yeah, -bin and LD_LIBRARY_PATH was wrong. --biesi 18:19, 28 December 2005 (PST)
Why do you need to run configure by hand?? client.mk takes care of all that for you! Furthermore, if you look at Jeff Carr's instructions more carefully, you'll see the following:
1 $ make -f mozilla/client.mk checkout MOZ_CO_PROJECT=all
2 $ ./configure --enable-application=browser
This leads to the following situation: he first checks out the source code for ALL projects (line 1), and then goes on to configure it for only building the browser (line 2). Instead he should simply do:
$ make -f client.mk checkout MOZ_CO_PROJECT=browser
$ make -f client.mk build
This only checks out what you actually want to build, and you don't have to clutter around with manually running configure. -- Andreas Wuest 18:34, 28 December 2005 (PST)
It makes that part of the instructions more generic. in fact, maybe MOZ_CO_PROJECTS should default to that... And I, at least, prefer running configure manually, as that's how (almost) every other open source project works. --biesi 19:10, 28 December 2005 (PST)
I can't get rid of the impression that
$ make -f client.mk build
is shorter than
$ ./configure
$ make -f client.mk build
And, FWIW, defaulting MOZ_CO_PROJECTS to browser is not really what all developers want, I guess. Though I can be mistaken. -- Andreas Wuest 19:29, 28 December 2005 (PST)
User:Callek notes this may be best forwarded to devmo-general than a talk page which is not really suited for "forum-like" discussions. --Callek 19:42, 28 December 2005 (PST)

Quick and easy build instructions part 2

Thanks for all the feedback everyone.

I'm experiementing with thunderbird. Yes, I had a copy and paste typo s/browser/mail/ So, the lines I am now using are:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot checkout mozilla/client.mk
make -f mozilla/client.mk checkout MOZ_CO_PROJECT=mail
./configure --enable-application=mail
make
./dist/bin/thunderbird

There seems to be some question about the LD_LIBRARY_PATH setting -- that is to make sure that you grab the right libraries. You can verify this with by examining the maps file for the thunderbird process. If you don't set the LD_LIBRARY_PATH, thunderbird may (?) look in /usr/lib/mozilla/ first. firefox seems to always check ../lib/ first so it works ok. Anyway, it's better safe than sorry.

tux@linux$ ps axuw |grep thunderbird
root     10712  1.3  1.6 99968 34324 pts/11  Sl   12:53   0:06 ./dist/bin/thunderbird-bin
tux@linux$ cat /proc/10712/maps |awk '{print $6}' |sort -u |less

Someone suggested running the scripts, so I guess I was wrong with using thunderbird-bin. I can't tell if the thunderbird script is enforcing usage of the libraries but it looks like export LD_LIBRARY_PATH=`pwd`/dist/lib is not necessary then.

Thanks again everyone. If these 5 lines are really correct then I'd recommend them for a "quick and easy" page. Jeff Carr 13:03, 29 December 2005 (PST)

The script sets LD_LIBRARY_PATH (or the equivalent for other platforms). BTW, it sets it to dist/bin which contains all the required libs. --biesi 13:21, 29 December 2005 (PST)

Revision Source

<h3 id="Update">Update</h3>
<p>As some of you may have noticed, this page is gradually getting out of date. With old refrences to LXR (I removed that to MXR) and to CVS, as well as unwritten sections, it would be nice to get this page up to date. It is more important with bug 471144 coming into the trunk, which will move many old readmes to this page and a link to here is planned to be put into the root readme for mozilla-central. <a href="/User:TylerD" rel="custom">TylerD</a> 02 January 2009</p>
<h3 id="Misc">Misc</h3>
<p>IMO, this should be replaced with <a class="external" href="http://www.mozilla.org/docs/source-directories-overview.html"></a>, which is both more accurate and easier to scan/read. --<a href="/User:Nickolay" title="User:Nickolay">Nickolay</a> 03:32, 27 December 2005 (PST)</p>
<p>No one should be using client.mk to pull the sources. So no, until the cvs repository is actually broken into pieces, there should be a page to cover the whole CVS repository. <a href="/User:Jeff_Carr" title="User:Jeff_Carr">Jeff Carr</a> 14:10, 27 December 2005 (PST)</p>
<p>client.mk is the only supported way of pulling the source to build any of the client apps. I'm not sure what you mean by "nobody should be..." -<a href="/User:DBaron" title="User:DBaron">David Baron</a> 16:29, 27 December 2005 (PST)</p>
<p>Those are the most confusing instructions ever. I screwed around on that page once before and gave up (the cvs instructions page). It suspect it didnt' help anyone else either. Note the only other comment put on that page was: can you please just put the cvs command to check this out. Make things simple:</p>
<pre class="eval">cvs -d <a class=" link-mailto" href="mailto::pserver:anonymous@cvs-mirror.mozilla.org" rel="freelink">:pserver:anonymous@cvs-mirror.mozilla.org</a>:/cvsroot checkout -P mozilla
</pre>
<p>Can you please explain why the above will not work? That's how I've checked out mozilla. I proceeded with:</p>
<pre class="eval">./configure --enable-application=browser
make
./dist/bin/firefox
</pre>
<p>Things seem fine to me. It's finally built. I don't understand why I had to screw around for 2 days to grok out these 4 commands. Thanks for your patience. I'm sure you will agree that it is useful to have streamlined instructions for new developers that are volunteers -- specifically instructions that save them as much time as possible :)</p>
<p><a href="/User:Jeff_Carr" title="User:Jeff_Carr">Jeff Carr</a> 18:34, 27 December 2005 (PST)</p>
<p>You are getting NSPR and NSS from the wrong branch (namely, HEAD). Mozilla normally uses a special branch of them. But yeah... it will usually work; fortunately NSPR/NSS care a lot about API compat.</p>
<p>However, I do want to note that the two commands that client.mk requires:</p>
<pre class="eval">cvs -d <a class=" link-mailto" href="mailto::pserver:anonymous@cvs-mirror.mozilla.org" rel="freelink">:pserver:anonymous@cvs-mirror.mozilla.org</a>:/cvsroot checkout mozilla/client.mk
make -f mozilla/client.mk checkout MOZ_CO_PROJECT=all
</pre>
<p>aren't much more complicated.</p>
<p>--<a href="/User:Biesi" title="User:Biesi">biesi</a> 18:53, 27 December 2005 (PST)</p>
<dl><dd> And above of that, listed on <a href="/en/Mozilla_Source_Code_(CVS)" title="en/Mozilla_Source_Code_(CVS)">Mozilla Source Code Via CVS</a> already for a long time ago ;) <a href="/User:Andreas_Wuest" title="User:Andreas_Wuest">Andreas Wuest</a> 19:01, 27 December 2005 (PST) </dd></dl>
<h3 id="Nice_Page" name="Nice_Page">Nice Page</h3>
<p>Thanks for updating this page and moving it into the wiki. It's very helpful. Now onto the thunderbird sources... <a href="/User:Jeff_Carr" title="User:Jeff_Carr">Jeff Carr</a> 18:52, 27 December 2005 (PST)</p>
<h3 id=".22Quick_and_easy_linux_build_instructions.22_page_proposal" name=".22Quick_and_easy_linux_build_instructions.22_page_proposal">"Quick and easy linux build instructions" page proposal</h3>
<p>OK, if I have this right then, the correct instructions for firefox can be reduced to:</p>
<pre class="eval">cvs -d <a class=" link-mailto" href="mailto::pserver:anonymous@cvs-mirror.mozilla.org" rel="freelink">:pserver:anonymous@cvs-mirror.mozilla.org</a>:/cvsroot checkout mozilla/client.mk
make -f mozilla/client.mk checkout MOZ_CO_PROJECT=all
./configure --enable-application=browser
make
export LD_LIBRARY_PATH=`pwd`/dist/lib; ./dist/bin/firefox
</pre>
<p>or for thunderbird:</p>
<pre class="eval">cvs -d <a class=" link-mailto" href="mailto::pserver:anonymous@cvs-mirror.mozilla.org" rel="freelink">:pserver:anonymous@cvs-mirror.mozilla.org</a>:/cvsroot checkout mozilla/client.mk
make -f mozilla/client.mk checkout MOZ_CO_PROJECT=all
./configure --enable-application=browser
make
export LD_LIBRARY_PATH=`pwd`/dist/lib; ./dist/bin/thunderbird-bin
</pre>
<p>If that is ok with everyone, then I think it would be really useful to have this as a page to simplify getting poeple up and running quickly.</p>
<p>Thanks, <a href="/User:Jeff_Carr" title="User:Jeff_Carr">Jeff Carr</a> 17:07, 28 December 2005 (PST)</p>
<dl><dd> There's a "cd mozilla" missing somewhere, and why are you setting LD_LIBRARY_PATH? --<a href="/User:Biesi" title="User:Biesi">biesi</a> 17:55, 28 December 2005 (PST) </dd></dl> <dl><dd> Oh, more things... Don't run the -bin binaries directly, use the scripts without them, so ./dist/bin/thunderbird. Also, don't use =browser if you want to build thunderbird. --<a href="/User:Biesi" title="User:Biesi">biesi</a> 17:56, 28 December 2005 (PST) </dd></dl> <dl><dd> Nope. An example for ckecking out Firefox from branch HEAD and building it would be: </dd></dl>
<pre class="eval">$ cvs -d <a class=" link-mailto" href="mailto::pserver:anonymous@cvs-mirror.mozilla.org" rel="freelink">:pserver:anonymous@cvs-mirror.mozilla.org</a>:/cvsroot login
(type the password "anonymous")
$ cvs -d <a class=" link-mailto" href="mailto::pserver:anonymous@cvs-mirror.mozilla.org" rel="freelink">:pserver:anonymous@cvs-mirror.mozilla.org</a>:/cvsroot co mozilla/client.mk
$ cd mozilla
$ make -f client.mk checkout MOZ_CO_PROJECT=browser
$ make -f client.mk build
</pre>
<dl><dd> It's all already on <a href="/en/Mozilla_Source_Code_(CVS)" title="en/Mozilla_Source_Code_(CVS)">Mozilla Source Code Via CVS</a> and <a href="/en/Build_and_Install" title="en/Build_and_Install">Build and Install</a>. Is it really that hard to figure that out? <a href="/User:Andreas_Wuest" title="User:Andreas_Wuest">Andreas Wuest</a> 17:25, 28 December 2005 (PST) </dd></dl> <dl><dd><dl><dd> login isn't needed. the instructions above seem fine to me, except for that LD_LIBRARY_PATH thing... --<a href="/User:Biesi" title="User:Biesi">biesi</a> 17:55, 28 December 2005 (PST) </dd></dl> </dd></dl> <dl><dd><dl><dd><dl><dd>Which instructions are you referring to now? Mine or Jeff Carr's? Login may not be needed, but running <code>configure</code> by hand, setting LD_LIBRARY_PATH and running *-bin directly is plain BS. It is all documented, just go and read <a href="/en/Build_Documentation" title="en/Build_Documentation">Build Documentation</a>, <a href="/en/Mozilla_Source_Code_(CVS)" title="en/Mozilla_Source_Code_(CVS)">Mozilla Source Code Via CVS</a> and <a href="/en/Build_and_Install" title="en/Build_and_Install">Build and Install</a>. What is so hard about reading these days? -- <a href="/User:Andreas_Wuest" title="User:Andreas_Wuest">Andreas Wuest</a> 18:04, 28 December 2005 (PST) </dd></dl> </dd></dl> </dd></dl> <dl><dd><dl><dd><dl><dd><dl><dd> Running <code>configure</code> is fine. But yeah, -bin and LD_LIBRARY_PATH was wrong. --<a href="/User:Biesi" title="User:Biesi">biesi</a> 18:19, 28 December 2005 (PST) </dd></dl> </dd></dl> </dd></dl> </dd></dl> <dl><dd><dl><dd><dl><dd><dl><dd><dl><dd>Why do you need to run <code>configure</code> by hand?? <code>client.mk</code> takes care of all that for you! Furthermore, if you look at Jeff Carr's instructions more carefully, you'll see the following: </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl>
<pre class="eval">1 $ make -f mozilla/client.mk checkout MOZ_CO_PROJECT=all
2 $ ./configure --enable-application=browser
</pre>
<dl><dd><dl><dd><dl><dd><dl><dd><dl><dd>This leads to the following situation: he first checks out the source code for ALL projects (line 1), and then goes on to configure it for only building the browser (line 2). Instead he should simply do: </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl>
<pre class="eval">$ make -f client.mk checkout MOZ_CO_PROJECT=browser
$ make -f client.mk build
</pre>
<dl><dd><dl><dd><dl><dd><dl><dd><dl><dd>This only checks out what you actually want to build, and you don't have to clutter around with manually running <code>configure</code>. -- <a href="/User:Andreas_Wuest" title="User:Andreas_Wuest">Andreas Wuest</a> 18:34, 28 December 2005 (PST) </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> <dl><dd><dl><dd><dl><dd><dl><dd><dl><dd><dl><dd> It makes that part of the instructions more generic. in fact, maybe MOZ_CO_PROJECTS should default to that... And I, at least, prefer running configure manually, as that's how (almost) every other open source project works. --<a href="/User:Biesi" title="User:Biesi">biesi</a> 19:10, 28 December 2005 (PST) </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> <dl><dd><dl><dd><dl><dd><dl><dd><dl><dd><dl><dd><dl><dd>I can't get rid of the impression that </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl>
<pre class="eval">$ make -f client.mk build
</pre>
<dl><dd><dl><dd><dl><dd><dl><dd><dl><dd><dl><dd><dl><dd>is shorter than </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl>
<pre class="eval">$ ./configure
$ make -f client.mk build
</pre>
<dl><dd><dl><dd><dl><dd><dl><dd><dl><dd><dl><dd><dl><dd>And, FWIW, defaulting MOZ_CO_PROJECTS to browser is not really what all developers want, I guess. Though I can be mistaken. -- <a href="/User:Andreas_Wuest" title="User:Andreas_Wuest">Andreas Wuest</a> 19:29, 28 December 2005 (PST) <dl><dd><a href="/User:Callek" title="User:Callek">User:Callek</a> notes this may be best forwarded to devmo-general than a talk page which is not really suited for "forum-like" discussions. --<a href="/User:Callek" title="User:Callek">Callek</a> 19:42, 28 December 2005 (PST) </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl> </dd></dl>
<h3 id="Quick_and_easy_build_instructions_part_2" name="Quick_and_easy_build_instructions_part_2">Quick and easy build instructions part 2</h3>
<p>Thanks for all the feedback everyone.</p>
<p>I'm experiementing with thunderbird. Yes, I had a copy and paste typo s/browser/mail/ So, the lines I am now using are:</p>
<pre class="eval">cvs -d <a class=" link-mailto" href="mailto::pserver:anonymous@cvs-mirror.mozilla.org" rel="freelink">:pserver:anonymous@cvs-mirror.mozilla.org</a>:/cvsroot checkout mozilla/client.mk
make -f mozilla/client.mk checkout MOZ_CO_PROJECT=mail
./configure --enable-application=mail
make
./dist/bin/thunderbird
</pre>
<p>There seems to be some question about the LD_LIBRARY_PATH setting -- that is to make sure that you grab the right libraries. You can verify this with by examining the maps file for the thunderbird process. If you don't set the LD_LIBRARY_PATH, thunderbird may (?) look in /usr/lib/mozilla/ first. firefox seems to always check ../lib/ first so it works ok. Anyway, it's better safe than sorry.</p>
<pre class="eval">tux@linux$ ps axuw |grep thunderbird
root     10712  1.3  1.6 99968 34324 pts/11  Sl   12:53   0:06 ./dist/bin/thunderbird-bin
tux@linux$ cat /proc/10712/maps |awk '{print $6}' |sort -u |less
</pre>
<p>Someone suggested running the scripts, so I guess I was wrong with using thunderbird-bin. I can't tell if the thunderbird script is enforcing usage of the libraries but it looks like export LD_LIBRARY_PATH=`pwd`/dist/lib is not necessary then.</p>
<p>Thanks again everyone. If these 5 lines are really correct then I'd recommend them for a "quick and easy" page. <a href="/User:Jeff_Carr" title="User:Jeff_Carr">Jeff Carr</a> 13:03, 29 December 2005 (PST)</p>
<p>The script sets LD_LIBRARY_PATH (or the equivalent for other platforms). BTW, it sets it to dist/bin which contains all the required libs. --<a href="/User:Biesi" title="User:Biesi">biesi</a> 13:21, 29 December 2005 (PST)</p>
Revert to this revision