Mozilla Source Code Directory Structure


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


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 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) 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 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

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 requires:

cvs -d checkout mozilla/
make -f mozilla/ 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 checkout mozilla/
make -f mozilla/ checkout MOZ_CO_PROJECT=all
./configure --enable-application=browser
export LD_LIBRARY_PATH=`pwd`/dist/lib; ./dist/bin/firefox

or for thunderbird:

cvs -d checkout mozilla/
make -f mozilla/ checkout MOZ_CO_PROJECT=all
./configure --enable-application=browser
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 login
(type the password "anonymous")
$ cvs -d co mozilla/
$ cd mozilla
$ make -f checkout MOZ_CO_PROJECT=browser
$ make -f 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?? 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/ 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 checkout MOZ_CO_PROJECT=browser
$ make -f 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 build
is shorter than
$ ./configure
$ make -f 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 checkout mozilla/
make -f mozilla/ checkout MOZ_CO_PROJECT=mail
./configure --enable-application=mail

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)