Closed Bug 453330 Opened 16 years ago Closed 16 years ago

Make it possible to build Sunbird from comm-central

Categories

(Calendar :: Build Config, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ssitter, Assigned: standard8)

References

Details

Attachments

(2 files, 7 obsolete files)

According to the current plans calendar development will switch to trunk-only and comm-central repository soon after the 0.9 release. Before that happens it should be possible to build Sunbird from comm-central too.
(In reply to comment #0)
> According to the current plans calendar development will switch to trunk-only
> and comm-central repository soon after the 0.9 release. Before that happens it
> should be possible to build Sunbird from comm-central too.

Without a lot of ifdefs you won't be able to build from cvs and comm-central at the same time. It is easier just to copy the files across, apply some patches and start builds from comm-central.

I have a WIP patch for this, based on what KaiRo did for Thunderbird & SeaMonkey, I'll post it in a moment.

You'll want a separate bug for transferring the tinderboxes over to buildbot so they can build with hg.
This patch should do most of the necessary changes. I have only tested it on Mac, but I expect it shouldn't be too far off for Windows & Linux.

Builds with --enable-official-branding will be broken as hg doesn't have the other-license/branding/sunbird directory. Copying those files across from the appropriate cvs directory into the same comm-central directory (next to the Thunderbird ones) should make this work.

To test this patch, you should be able to pull an existing comm-central repository (including calendar from cvs), apply the patch and build sunbird. At the moment client.py will still pull/update from cvs.

When it comes to the actual move, we'll copy across all files from cvs (except for .cvsignore, files in CVS directories), add them to hg, and then apply the patches.
Assignee: nobody → bugzilla
Revised patch, hopefully fixes problems with finding helper.exe.
Attachment #337406 - Attachment is obsolete: true
This version also supports building from Linux (static + non static).
Attachment #338152 - Attachment is obsolete: true
Adds missing app-config.mk file.
Attachment #338709 - Attachment is obsolete: true
I get the following error when building on win32:

/e/mozilla-build/moztools/bin/nsinstall -D ../../../mozilla/dist/bin/uninstall
cp instgen/helper.exe ../../../mozilla/dist/bin/uninstall
cp: cannot stat `instgen/helper.exe': No such file or directory
make[5]: *** [uninstaller] Error 1
make[5]: Leaving directory `/e/obj/calendar/installer/windows'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/e/obj/calendar/sunbird'
make[3]: *** [libs_tier_app] Error 2
make[3]: Leaving directory `/e/obj'
make[2]: *** [tier_app] Error 2
make[2]: Leaving directory `/e/obj'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/e/obj'
make: *** [build] Error 2

I think the build doesn't enters the ifdef MOZ_SUNBIRD block but the else block in http://hg.mozilla.org/mozilla-central/file/6923494a747a/toolkit/mozapps/installer/windows/nsis/makensis.mk#85
Comment on attachment 338735 [details] [diff] [review]
Sunbird build support in comm-central v4

With this patch the win32 build runs further but finally fails with:
set -e;  \
        /bin/perl -pe 's/(?<!\r)\n/\r\n/g;' < /e/dev/tb-trunk/src/LICENSE > ../../../mozilla/dist/bin/LICENSE
/bin/sh: /e/dev/tb-trunk/src/LICENSE: No such file or directory
make[5]: *** [libs] Error 1
make[5]: Leaving directory `/e/dev/obj/sb-comm-central/calendar/sunbird/app'
make[4]: *** [libs] Error 2
make[4]: Leaving directory `/e/dev/obj/sb-comm-central/calendar/sunbird'
make[3]: *** [libs_tier_app] Error 2
make[3]: Leaving directory `/e/dev/obj/sb-comm-central'
make[2]: *** [tier_app] Error 2
make[2]: Leaving directory `/e/dev/obj/sb-comm-central'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/e/dev/obj/sb-comm-central'
make: *** [build] Error 2
I actually would go for importing the current state into comm-central, getting it to build right there, and just check in further patches to both cvs and comm-central for the hopefully short time until 0.9 final.

I'd be happy to do the actual import into comm-central, by the way, as I've done the initial import of the other sources there and know how it's done best.
Thanks KaiRo. Go ahead, this makes sense to me.
(In reply to comment #8)
> I actually would go for importing the current state into comm-central, getting
> it to build right there, and just check in further patches to both cvs and
> comm-central for the hopefully short time until 0.9 final.

I don't mind that, I was just helping to get something moving which, given most of the calendar team still seemed to be focus on 0.9, would give a good chance of moving to comm-central as soon as they are ready and hence be able to start the trunk work.

At the moment, the patch probably isn't far off being ready for review especially as I think there's most likely just one problem remaining for en-US builds.

(In reply to comment #7)
> (From update of attachment 338735 [details] [diff] [review])
> With this patch the win32 build runs further but finally fails with:
> set -e;  \
>         /bin/perl -pe 's/(?<!\r)\n/\r\n/g;' < /e/dev/tb-trunk/src/LICENSE >
> ../../../mozilla/dist/bin/LICENSE
> /bin/sh: /e/dev/tb-trunk/src/LICENSE: No such file or directory

comm-central doesn't have a LICENSE file in its root directory. I actually commented out the non-windows line in calendar/app/Makefile.in, but not the windows version.

So I've just looked at SM/TB etc, and I've now just pointed the source for that file at mozilla/LICENSE (using MOZILLA_SRCDIR) - new patch in a moment. This should mean that you at least have an app build, even if the windows/installer section fails.
Fix the license file copying.
Attachment #338735 - Attachment is obsolete: true
KaiRo: If you haven't planned already, you could spend a cvs tag for hg takeover (or document the exact time stamp), so it's easier for us to get the missing checkins later on to comm-central.
A CVS tag is in the plan anyway, just so that we can potentially hook in a webtool script that does backwards history from the point where we imported to hg.

So, once I have a "go" for a specific point in (cvs) history (can be "whatever is HEAD when I'm doing it"), I can do the tagging and importing - you just need to communicate to calendar people to check in all changes after that point to comm-central as well. I had planned to try and make it to tomorrow's calendar call so we can sign this off, but I can start on your word as well, I guess. ;-)
Updated patch fixes some issues building win32 zip package, win32 installer and langpacks.
Attachment #338847 - Attachment is obsolete: true
Depends on: 455727
Sunbird probably also wants to add the changes I did in bug 453840 to Windows installer and locales stuff, see http://hg.mozilla.org/comm-central/rev/417d21c160a9
Calendar code as well as Sunbird branding have landed on comm-central now in bug 455727. I'll leave it to the bug here to ensure Sunbird builds correctly from there.
Comment on attachment 338935 [details] [diff] [review]
Sunbird build support in comm-central v6

These changes will get Sunbird building on comm-central. We can port the changes from bug 453840 later, or sooner if they are really needed, but for now, lets just get at least dev builds going.

Requesting review from ause so that he can start learning the new build system ;-)

If you want anyone else to review it as well ause, please say so.
Attachment #338935 - Flags: review?(ause)
Status: NEW → ASSIGNED
Updated patch that applies straight to a hg repository (use hg qimport/hg import/git-apply).
Attachment #338935 - Attachment is obsolete: true
Attachment #339429 - Flags: review?(ause)
Attachment #338935 - Flags: review?(ause)
Blocks: 456037
Two comments:
- calendar-timezones.xpi isn't preinstalled in my Sunbird build, I need to set

MOZ_SUNBIRD=1

in my mozconfig file.

- Building a lightning.xpi on top of the sunbird build, it lacks a generated Makefile in calendar/itip (although calendar/lightning/Makefile.in has a DIRS = ../itip). If I add

calendar/itip/Makefile

to calendar/lightning/makefiles.sh, everything's fine.
(In reply to comment #19)
> Two comments:

I don't understand either of these errors

> - calendar-timezones.xpi isn't preinstalled in my Sunbird build, I need to set

MOZ_SUNBIRD should be set in calendar/app-config.mk which is pulled in by config/config.mk. Can you see if SUNBIRD_VERSION or MOZ_APP_VERSION is set correctly? If it isn't, it implies MOZ_BUILD_APP is wrong which implies you've not got --enable-application=calendar but something else.

> - Building a lightning.xpi on top of the sunbird build, it lacks a generated
> Makefile in calendar/itip (although calendar/lightning/Makefile.in has a DIRS =
> ../itip). If I add
> 
> calendar/itip/Makefile
> 
> to calendar/lightning/makefiles.sh, everything's fine.

What do you mean on top of a sunbird build?
(In reply to comment #19)
> Two comments:
> - calendar-timezones.xpi isn't preinstalled in my Sunbird build, I need to set
> 
> MOZ_SUNBIRD=1
> 
> in my mozconfig file.

Yes, the MOZ_SUNBIRD=1 line shound't be removed from confvars.sh, not sure why Mark has that in the patch - this affects configure, while app-config.mk affects Makefiles.
(In reply to comment #20)
> (In reply to comment #19)
> > Two comments:
> 
> I don't understand either of these errors
> 
> > - calendar-timezones.xpi isn't preinstalled in my Sunbird build, I need to set
> 
> MOZ_SUNBIRD should be set in calendar/app-config.mk which is pulled in by
> config/config.mk. Can you see if SUNBIRD_VERSION or MOZ_APP_VERSION is set
> correctly? If it isn't, it implies MOZ_BUILD_APP is wrong which implies you've
> not got --enable-application=calendar but something else.

Yes, both SUNBIRD_VERSION and MOZ_APP_VERSION are set correctly, but MOZ_SUNBIRD is set empty in autoconf.mk.

> > - Building a lightning.xpi on top of the sunbird build, it lacks a generated
> > Makefile in calendar/itip (although calendar/lightning/Makefile.in has a DIRS =
> > ../itip). If I add
> > 
> > calendar/itip/Makefile
> > 
> > to calendar/lightning/makefiles.sh, everything's fine.
> 
> What do you mean on top of a sunbird build?

i.e.
cd $MOZ_OBJDIR/calendar/lightning && make
Put MOZ_SUNBIRD back into confvars.sh - this should fix some of the build problems. Why I wasn't seeing them, I've got no idea.
Attachment #339429 - Attachment is obsolete: true
Attachment #339509 - Flags: review?(ause)
Attachment #339429 - Flags: review?(ause)
some more directories to create makefiles, one small addition to have sunbird and lightning in one build.
Attachment #339509 - Attachment is obsolete: true
Attachment #339509 - Flags: review?(ause)
Attachment #339956 - Flags: review?(bugzilla)
Comment on attachment 339956 [details] [diff] [review]
[checked in] Sunbird build support in comm-central v8

I think given that I wrote most of the patch I shouldn't review it.

Robert do you feel like it, if not pass it to Callek?
Attachment #339956 - Flags: review?(bugzilla) → review?(kairo)
Comment on attachment 339509 [details] [diff] [review]
Sunbird build support in comm-central v7

this patch is fine. the following one just adds some small changes for multiprocess builds and --enable-calendar in sunbird builds
Attachment #339509 - Attachment is obsolete: false
Attachment #339509 - Flags: review+
Comment on attachment 339956 [details] [diff] [review]
[checked in] Sunbird build support in comm-central v8

just the changes to v7 need review
Attachment #339956 - Flags: review?(kairo) → review?(bugzilla)
Comment on attachment 339956 [details] [diff] [review]
[checked in] Sunbird build support in comm-central v8

Yep the changes look fine here.
Attachment #339956 - Flags: review?(bugzilla) → review+
Comment on attachment 339956 [details] [diff] [review]
[checked in] Sunbird build support in comm-central v8

Checked in changeset id: 419:1c56991ab099
Attachment #339956 - Attachment description: Sunbird build support in comm-central v8 → [checked in] Sunbird build support in comm-central v8
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
btw if you need the details, see http://developer.mozilla.org/en/docs/comm-central for more information about comm-central and how to build from it.
Status: RESOLVED → VERIFIED
These bugs are likely targeted at Lightning 1.0b1, not Lightning 1.0. If this change was done in error, please adjust the target milestone to its correct value. To filter on this bugspam, you can use "lightning-10-target-move".
Target Milestone: 1.0 → 1.0b1
You need to log in before you can comment on or make changes to this bug.