SeaMonkey:hg-based build: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(remove another hack!)
m (→‎building with Lightning calendar: add note about seamonkey lightning...)
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Based on the [[SeaMonkey/1.9.1_Repository_Options]], I figured out how to build with the "option A" listed there, for now with the source that is not part of mozilla-central pulled from the old cvs repository.
The work for building SeaMonkey and Thunderbird with mozilla-central has originally been based on the [[SeaMonkey/1.9.1_Repository_Options]], and then refined following [[MailNews:HgMeetingNotes]] to use it own testing repository.


=== building SeaMonkey ===
The new [http://hg.mozilla.org/comm-central/ comm-central] Mercurial repository contains SeaMonkey and Thunderbird code for now, calendar will follow at a later date. All of those codebases are imported as static snapshots from CVS, without keeping history, which will be available through cvs and web tools. The shared repository contains its own build system files, which started off as copies of the Mozilla equivalents, with some path adjustments and removals of not needed parts. For now, they call into lots of mozilla files, which can be gradually reduced over time so that in the end SeaMonkey and Thunderbird can build with some sort of a XULRunner SDK.


* pull mozilla-central into mozilla/
The pages about [http://developer.mozilla.org/en/docs/Mozilla_Source_Code_%28Mercurial%29 getting Mozilla code via hg] and [http://developer.mozilla.org/en/docs/Mercurial Mercurial (hg) itself] as well as [http://developer.mozilla.org/en/docs/comm-central comm-central] from Mozilla Developer Center are probably helpful when dealing with the repositories.
* pull from CVS: suite/
* pull from CVS: mailnews/
* pull from CVS: extensions/[irc|typeaheadfind|venkman|wallet|xml-rpc] - symlink them into mozilla/extensions
* pull from CVS: directory/ - symlink into mozilla/
* mozconfig: --enable-application=../suite
* mozconfig: mk_add_options MOZ_OBJDIR=/path/to/objdir/mozilla  (note the "mozilla" at the end!)
* suite/build.mk: prefix mailnews/ and suite/ with ..
* suite/makefiles.sh: prefix all suite/ directories in add_makefiles with "../"
* mailnews/makefiles.sh: prefix all mailnews/ directories in add_makefiles with "../"
* suite/confvars.sh: add the following line before MOZ_APP_VERSION (line 47) (without indentation):
    SEAMONKEY_VERSION=`cat $topsrcdir/../suite/config/version.txt`
* suite/app-config.mk: create this file, containing the following lines (without indentation):
    MOZ_SUITE = 1
    SEAMONKEY_VERSION = $(MOZ_APP_VERSION)
    DEFINES += -DMOZ_SUITE=1
* mozilla/toolkit/toolkit-makefiles.sh: move mailnews block at line 913 to suite/makefiles.sh line 38
* cd mailnews/; sed -i 's/^DEPTH.*\.\.$/&\/mozilla/g' `find . -name Makefile.in`
* cd suite/; sed -i 's/^DEPTH.*\.\.$/&\/mozilla/g' `find . -name Makefile.in`
* suite/debugQA/locales/Makefile.in: prefix relativesrcdir in line 44 with ../
* suite/locales/Makefile.in: prefix relativesrcdir in line 41 with ../
* still suite/locales/Makefile.in: change line 163 to use that additional expansion macro
* suite/build/Makefile.in: in the LOCAL_INCLUDES starting in line 74, add a ../ between $(topsrcdir)/ and suite/


build using
=== Building SeaMonkey or Thunderbird ===
export MOZCONFIG=/path/to/mozconfig
cd mozilla
gmake -f client.mk build


=== for unit tests ===
* pull comm-central
  hg clone http://hg.mozilla.org/comm-central/ src
  cd src
* update/pull all other needed source via client.py
  python client.py checkout
* make sure you have autoconf 2.13 installed, see [http://developer.mozilla.org/en/docs/Mozilla_Source_Code_%28Mercurial%29#Autoconf_2.13 the comment about this on MDC]
* create a mozconfig, using
** --enable-application=suite (for SeaMonkey)
** --enable-application=mail (for Thunderbird)
* build using client.mk:
  make -f client.mk build


Note that correct makefiles.sh files paper over the problem that make-makefiles does get confused with us being outside mozilla/ ({{bug|437896}}) but test makefiles rely on that automatic generation, so unit tests only can get built with a patch for that bug.
=== Building with Lightning (the integrated calendar) ===


* mailnews/imap/test/Makefile.in: in the LOCAL_INCLUDES line 74, add a ../ between $(topsrcdir)/ and mailnews/
Note! SeaMonkey doesn't work with lightning yet (bug 313822).
* mailnews/base/test/unit/head_mailbase.js: prefix "mailnews" directory with a "../"
* mailnews/db/msgdb/test/unit/head_maildb.js: prefix "mailnews" directory with a "../"
* mailnews/db/msgdb/test/unit/test_maildb.js: prefix "mailnews" directory with a "../"
* mailnews/news/test/unit/head_server_setup.js: prefix "mailnews" directory with a "../"
* mailnews/news/test/unit/test_server.js: prefix "mailnews" directory with a "../" in line 104
* mailnews/local/test/unit/head_maillocal.js: prefix "mailnews" directory with a "../"
* mailnews/compose/test/unit/head_compose.js: prefix "mailnews" directory with a "../"
* mailnews/compose/test/unit/test_sendMailMessage.js: prefix "mailnews" directory with a "../" in line 20
* mailnews/compose/test/unit/test_nsMsgCompose1.js: prefix "mailnews" directory with a "../" in lines 7,49,54
* mailnews/addrbook/test/unit/head_addrbook.js: prefix "mailnews" directory with a "../"
* mailnews/addrbook/test/unit/test_cardForEmail.js: prefix "mailnews" directory with a "../" in line 13
* mailnews/addrbook/test/unit/test_mailList1.js: prefix "mailnews" directory with a "../" in line 35
* mailnews/addrbook/test/unit/test_nsIAbCard.js: prefix "mailnews" directory with a "../" in line 14
* mailnews/extensions/bayesian-spam-filter/test/unit/head_bayes.js: prefix "mailnews" directory with a "../"
* mailnews/extensions/bayesian-spam-filter/test/unit/test_bug228675.js: prefix "mailnews" directory with a "../" in lines 41,155


=== additional changes to build Thunderbird ===
In your .mozconfig file: add the following line:
ac_add_options --enable-calendar


* pull from CVS: mail/
== Common Mistakes ==
* mozconfig: --enable-application=../mail
=== Build error when importing example mozconfig ===
* mozconfig: mk_add_options MOZ_OBJDIR=/path/to/objdir/mozilla (again, note the "mozilla" at the end!)
 
* cd mail/; sed -i 's/^DEPTH.*\.\.$/&\/mozilla/g' `find . -name Makefile.in`
If you get the following build error:
* mail/build.mk: prefix mailnews/ and mail/ with ..
/src/mozilla/configure: /src/mozilla/mail/config/mozconfig: No such file or directory
* mail/makefiles.sh: add removed mailnews block from mozilla/toolkit/toolkit-makefiles.sh line 913 at line 38
 
* mail/makefiles.sh: prefix all mail/ directories in add_makefiles with "../"
Open your mozconfig and change the line:  
* mail/confvars.sh: add the following line before MOZ_APP_VERSION (line 55) (without indentation):
. $topsrcdir/mail/config/mozconfig
    THUNDERBIRD_VERSION=`cat $topsrcdir/../mail/config/version.txt`
 
* mail/app-config.mk: create this file, containing the following lines (without indentation):
To:
    MOZ_THUNDERBIRD = 1
ac_add_options --enable-application=mail
    THUNDERBIRD_VERSION = $(MOZ_APP_VERSION)
 
    DEFINES += -DMOZ_THUNDERBIRD=1
The original problem happens because when configuring in mozilla/ (mozilla-central) it reads mozilla/ as the topsrcdir and errors out in that it can't find the inclusion you want.
* mail/locales/Makefile.in: after inclusion of config.mk, add the following two lines (without indentation):
 
    # HACK: make the locale expansion not insert the mozilla/ subdir for en-US
As we have other solutions for setting the configuration defaults nowadays, the --enable-application line is the only one we really need out of there.
    EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/../$(1)/en-US,$(topsrcdir)/../l10n/$(AB_CD)/$(subst /locales,,$(1)))
 
    EXPAND_LOCALE_SRCDIR_PLATFORM = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/$(1)/en-US,$(topsrcdir)/../l10n/$(AB_CD)/$(subst /locales,,$(1)))
=== cvs checkout error with client.py ===
* still mail/locales/Makefile.in: change line 132 to use the latter expansion macro; prefix "mailnews" in line 104 with "../"
 
* mail/base/jar.mn: replace /mailnews/ with /../mailnews/ (right-hand side)
If you get the following error from client.py:
* mail/components/compose/jar.mn: replace /mailnews/ with /../mailnews/ (right-hand side)
Executing command: ['cvs', '-d', '/usr/local/cvsroot', '-q', 'checkout', '-P', '-r', 'HEAD', '-d', 'calendar', 'mozilla/calendar']
* mail/components/preferences/jar.mn: replace /mailnews/ with /../mailnews/ (right-hand side)
cvs checkout: cannot find module `mozilla/calendar' - ignored
* mail/components/addrbook/jar.mn: replace /mailnews/ with /../mailnews/ (right-hand side)
Traceback (most recent call last):
* mail/extensions/smime/jar.mn: replace /mailnews/ with /../mailnews/ (right-hand side)
  File "client.py", line 149, in <module>
* mail/app/Makefile.in: insert ../ between $(topsrcdir)/ and mail/ in line 52
    do_cvs_checkout(CVS_DIRS, CVS_CO_TAG, options.cvsroot, options.cvs, '')
  File "client.py", line 71, in do_cvs_checkout
    cwd=os.path.join(topsrcdir, checkoutdir, parent))
  File "client.py", line 45, in check_call_noisy
    check_call(cmd, *args, **kwargs)
  File "/usr/lib/python2.5/subprocess.py", line 462, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cvs', '-d', '/usr/local/cvsroot', '-q', 'checkout', '-P', '-r', 'HEAD', '-d', 'calendar', 'mozilla/calendar']' returned non-zero exit status 1
 
then it looks like your CVSROOT environment variable is set to '/usr/local/cvsroot', try unsetting it before calling client.py.

Latest revision as of 18:21, 25 August 2008

The work for building SeaMonkey and Thunderbird with mozilla-central has originally been based on the SeaMonkey/1.9.1_Repository_Options, and then refined following MailNews:HgMeetingNotes to use it own testing repository.

The new comm-central Mercurial repository contains SeaMonkey and Thunderbird code for now, calendar will follow at a later date. All of those codebases are imported as static snapshots from CVS, without keeping history, which will be available through cvs and web tools. The shared repository contains its own build system files, which started off as copies of the Mozilla equivalents, with some path adjustments and removals of not needed parts. For now, they call into lots of mozilla files, which can be gradually reduced over time so that in the end SeaMonkey and Thunderbird can build with some sort of a XULRunner SDK.

The pages about getting Mozilla code via hg and Mercurial (hg) itself as well as comm-central from Mozilla Developer Center are probably helpful when dealing with the repositories.

Building SeaMonkey or Thunderbird

  • pull comm-central
 hg clone http://hg.mozilla.org/comm-central/ src
 cd src
  • update/pull all other needed source via client.py
 python client.py checkout
  • make sure you have autoconf 2.13 installed, see the comment about this on MDC
  • create a mozconfig, using
    • --enable-application=suite (for SeaMonkey)
    • --enable-application=mail (for Thunderbird)
  • build using client.mk:
 make -f client.mk build

Building with Lightning (the integrated calendar)

Note! SeaMonkey doesn't work with lightning yet (bug 313822).

In your .mozconfig file: add the following line:

ac_add_options --enable-calendar

Common Mistakes

Build error when importing example mozconfig

If you get the following build error:

/src/mozilla/configure: /src/mozilla/mail/config/mozconfig: No such file or directory

Open your mozconfig and change the line:

. $topsrcdir/mail/config/mozconfig

To:

ac_add_options --enable-application=mail

The original problem happens because when configuring in mozilla/ (mozilla-central) it reads mozilla/ as the topsrcdir and errors out in that it can't find the inclusion you want.

As we have other solutions for setting the configuration defaults nowadays, the --enable-application line is the only one we really need out of there.

cvs checkout error with client.py

If you get the following error from client.py:

Executing command: ['cvs', '-d', '/usr/local/cvsroot', '-q', 'checkout', '-P', '-r', 'HEAD', '-d', 'calendar', 'mozilla/calendar']
cvs checkout: cannot find module `mozilla/calendar' - ignored
Traceback (most recent call last):
  File "client.py", line 149, in <module>
    do_cvs_checkout(CVS_DIRS, CVS_CO_TAG, options.cvsroot, options.cvs, )
  File "client.py", line 71, in do_cvs_checkout
    cwd=os.path.join(topsrcdir, checkoutdir, parent))
  File "client.py", line 45, in check_call_noisy
    check_call(cmd, *args, **kwargs)
  File "/usr/lib/python2.5/subprocess.py", line 462, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cvs', '-d', '/usr/local/cvsroot', '-q', 'checkout', '-P', '-r', 'HEAD', '-d', 'calendar', 'mozilla/calendar']' returned non-zero exit status 1

then it looks like your CVSROOT environment variable is set to '/usr/local/cvsroot', try unsetting it before calling client.py.