Closed Bug 674352 Opened 13 years ago Closed 13 years ago

Precompile startup cache for Thunderbird

Categories

(Thunderbird :: Build Config, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 8.0

People

(Reporter: standard8, Assigned: Bienvenu)

References

Details

(Keywords: perf)

Attachments

(2 files, 1 obsolete file)

+++ This bug was initially created as a clone of Bug #655678 +++

From bug 655678 comment 2:

> The seamonkey and thunderbird folks should be interested, too. (with the
> patch, you only need to add GENERATE_CACHE=1 before including packager.mk to
> benefit from startupcache, if you're omnijar'ed)
When I do this, make installer fails

  adding: greprefs.js (172 bytes security) (deflated 74%)
can't open ../../../toolkit/mozapps/installer/precompile_cache.js: No such file
or directory
-e:1: ReferenceError: populate_startupcache is not defined

If I had to guess as to the cause, I'd say it was because we put the mozilla tree under the source directory, so the correct path would be:

../../mozilla/toolkit/mozapps/installer/precompile_cache.js

I'll see if we can control this somehow in our Makefile.
I'm going to try this change to packager.mk to see if it fixes the issue:

diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/p
ackager.mk
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -386,17 +386,17 @@ ifdef MOZ_OMNIJAR

 ifdef GENERATE_CACHE
 ifneq (1_,$(if $(CROSS_COMPILE),1,0)_$(UNIVERSAL_BINARY))
 ifdef RUN_TEST_PROGRAM
 _ABS_RUN_TEST_PROGRAM = $(call core_abspath,$(RUN_TEST_PROGRAM))
 endif

 GENERATE_CACHE = \
-  $(_ABS_RUN_TEST_PROGRAM) $(LIBXUL_DIST)/bin/xpcshell$(BIN_SUFFIX) -g "$$PWD"
-a "$$PWD" -f $(topsrcdir)/toolkit/mozapps/installer/precompile_cache.js -e 'pop
ulate_startupcache("omni.jar", "startupCache.zip");' && \
+  $(_ABS_RUN_TEST_PROGRAM) $(LIBXUL_DIST)/bin/xpcshell$(BIN_SUFFIX) -g "$$PWD"
-a "$$PWD" -f $(MOZILLA_DIR)/toolkit/mozapps/installer/precompile_cache.js -e 'p
opulate_startupcache("omni.jar", "startupCache.zip");' && \
   rm -rf jsloader && \
   $(UNZIP) startupCache.zip && \
   rm startupCache.zip && \
   $(ZIP) -r9m omni.jar jsloader
 endif
 endif

 GENERATE_CACHE ?= true
Yeah, MOZILLA_DIR is what we'll need there.
sadly, that didn't help:

  adding: greprefs.js (172 bytes security) (deflated 74%)
can't open ../../../mozilla/toolkit/mozapps/installer/precompile_cache.js: No su
ch file or directory
-e:1: ReferenceError: populate_startupcache is not defined
make[1]: *** [make-package] Error 3
make[1]: Leaving directory `/c/builds/tbirdrel/objdir-tb/mail/installer'
make: *** [all] Error 2

/c/builds/tbirdrel/objdir-tb/mail/installer
$ ls ../../../mozilla/toolkit/mozapps/installer/precompile_cache.js
../../../mozilla/toolkit/mozapps/installer/precompile_cache.js

which is weird, because the path did change, and does seem to contain the file.
MOZILLA_SRCDIR produced the same error.
The issue is as follows, as best I can tell from looking at the make output. The packaging is run from <objdir>/mozilla/dist/thunderbird, i.e.,

cd ../../mozilla/dist && (cd thunderbird 

MOZILLA_SRCDIR is set to ../../../mozilla which is not the mozilla src dir, but rather the mozilla sub-dir of the objdir, in the Thunderbird build system.

&& rm -f omni.jar components/binary.man
ifest && grep -h '^binary-component' components/*.manifest > binary.manifest ; f
or m in components/*.manifest; do sed -e 's/^binary-component/#binary-component/
' $m > tmp.manifest && mv tmp.manifest $m; done; zip -r9m omni.jar chrome chrome
.manifest components/*.js components/*.xpt components/*.manifest modules res def
aults greprefs.js jsloader  -x defaults/messenger/mailViews.dat chrome/icons/\*
defaults/pref/channel-prefs.js res/cursors/\* res/MainMenu.nib/\*  &&  c:/builds
/tbirdrel/objdir-tb/mozilla/dist/bin/xpcshell.exe -g "$PWD" -a "$PWD" -f ../../.
./mozilla/toolkit/mozapps/installer/precompile_cache.js -e 'populate_startupcach
e("omni.jar", "startupCache.zip");' && rm -rf jsloader && unzip startupCache.zip
 && rm startupCache.zip && zip -r9m omni.jar jsloader && c:/mozilla-build/python

I'm not sure why MOZILLA_SRCDIR is wrong for me, but I'll poke at it some more. I suspect it's because we're running the packaging from an unexpected directory, as far as our building the installer is concerned.
My mozconfig was specifying an objdir - once I took that out, I didn't see the build errors anymore. I'll push to try a patch with just the package change and see if that works.
Attached patch mozilla central part of fix (obsolete) — Splinter Review
Thunderbird needs this in order to be able to precompile the startup cache. MOZILLA_SRCDIR is not topdir for Thunderbird builds. Firefox should be OK with this change, but I'm trying it as well.
Assignee: nobody → dbienvenu
Attachment #550448 - Flags: review?(khuey)
Attachment #550450 - Flags: review?(mbanner)
the prev moz-central patch seemed to break firefox's build of the installer. This one seems to work for both ffox and tb, though I'm not sure what the difference between MOZILLA_DIR and MOZILLA_SRCDIR is.
Attachment #550448 - Attachment is obsolete: true
Attachment #550448 - Flags: review?(khuey)
Attachment #550523 - Flags: review?(khuey)
Comment on attachment 550523 [details] [diff] [review]
fix that seems to work for ffox and tb

Ah MOZILLA_SRCDIR is a comm-central only thing, so MOZILLA_DIR is the right thing to use.
Comment on attachment 550523 [details] [diff] [review]
fix that seems to work for ffox and tb

r=me
Attachment #550523 - Flags: review?(khuey) → review+
Comment on attachment 550523 [details] [diff] [review]
fix that seems to work for ffox and tb

Checked into mozilla-inbound:

http://hg.mozilla.org/integration/mozilla-inbound/rev/1762d5d119fb
Attachment #550450 - Flags: review?(mbanner) → review+
fixed on trunk - http://hg.mozilla.org/comm-central/rev/e1ae2ddb930c

Kyle, thx for your help. I'm not sure if we've done the merge or not, so I've set the TFV to 9...
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 9.0
This made the merge on mozilla-central.  I wasn't sure whether or not there was more to do here on the c-c side so I left it open.
(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #16)
> This made the merge on mozilla-central.  I wasn't sure whether or not there
> was more to do here on the c-c side so I left it open.

You did the right thing - I was referring to the c-c part of the work, which I just landed.
Target Milestone: Thunderbird 9.0 → Thunderbird 8.0
You need to log in before you can comment on or make changes to this bug.