Bug 834228 - Force a stage-package to run before buildsymbols on universal builds. r=ted,gps
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 25 Jan 2013 00:40:13 +0100
changeset 119742 6420c37f69542232813954aa4635eef679da7c1e
parent 119741 bf60e2782355d38b94e6c7b38a942056af56bbad
child 119743 6e3ed198bcacf1917d8616d06282787418471426
push id24222
push usermh@glandium.org
push dateThu, 24 Jan 2013 23:43:13 +0000
treeherdermozilla-central@169e0492b03b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, gps
bugs834228
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 834228 - Force a stage-package to run before buildsymbols on universal builds. r=ted,gps Also, always strip and elfhack executables, so that running make package after a PKG_SKIP_STRIP=1 stage-package does strip ; but disable both for l10n-repacks and unpack.
build/macosx/universal/flight.mk
python/mozbuild/mozpack/files.py
python/mozbuild/mozpack/unify.py
toolkit/mozapps/installer/l10n-repack.py
toolkit/mozapps/installer/unpack.py
--- a/build/macosx/universal/flight.mk
+++ b/build/macosx/universal/flight.mk
@@ -18,20 +18,24 @@ endif
 topsrcdir = $(TOPSRCDIR)
 include $(OBJDIR)/config/autoconf.mk
 
 core_abspath = $(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1))
 
 DIST = $(OBJDIR)/dist
 
 postflight_all:
-ifdef ENABLE_TESTS
 	mkdir -p $(DIST_UNI)/$(MOZ_PKG_APPNAME)
 	rm -f $(DIST_ARCH_2)/universal
 	ln -s $(call core_abspath,$(DIST_UNI)) $(DIST_ARCH_2)/universal
+# Stage a package for buildsymbols to be happy. Doing so in OBJDIR_ARCH_1
+# actually does a universal staging with both OBJDIR_ARCH_1 and OBJDIR_ARCH_2.
+	$(MAKE) -C $(OBJDIR_ARCH_1)/$(INSTALLER_DIR) \
+	   PKG_SKIP_STRIP=1 stage-package
+ifdef ENABLE_TESTS
 # Now, repeat the process for the test package.
 	$(MAKE) -C $(OBJDIR_ARCH_1) UNIVERSAL_BINARY= CHROME_JAR= package-tests
 	$(MAKE) -C $(OBJDIR_ARCH_2) UNIVERSAL_BINARY= CHROME_JAR= package-tests
 	rm -rf $(DIST_UNI)/test-package-stage
 # automation.py differs because it hardcodes a path to
 # dist/bin. It doesn't matter which one we use.
 	if test -d $(DIST_ARCH_1)/test-package-stage -a                 \
                 -d $(DIST_ARCH_2)/test-package-stage; then              \
--- a/python/mozbuild/mozpack/files.py
+++ b/python/mozbuild/mozpack/files.py
@@ -134,18 +134,17 @@ class File(BaseFile):
 
 class ExecutableFile(File):
     '''
     File class for executable and library files on OS/2, OS/X and ELF systems.
     (see mozpack.executables.is_executable documentation).
     '''
     def copy(self, dest):
         assert isinstance(dest, basestring)
-        if not File.copy(self, dest):
-            return False
+        File.copy(self, dest)
         try:
             if may_strip(dest):
                 strip(dest)
             if may_elfhack(dest):
                 elfhack(dest)
         except ErrorMessage:
             os.remove(dest)
             raise
--- a/python/mozbuild/mozpack/unify.py
+++ b/python/mozbuild/mozpack/unify.py
@@ -5,16 +5,17 @@
 from mozpack.files import (
     FileFinder,
     ExecutableFile,
     BaseFile,
     GeneratedFile,
 )
 from mozpack.executables import (
     MACHO_SIGNATURES,
+    may_strip,
     strip,
 )
 from mozpack.errors import errors
 from tempfile import mkstemp
 import mozpack.path
 import shutil
 import struct
 import os
@@ -53,17 +54,18 @@ class UnifiedExecutableFile(BaseFile):
         assert isinstance(dest, basestring)
         tmpfiles = []
         try:
             for p in [self.path1, self.path2]:
                 fd, f = mkstemp()
                 os.close(fd)
                 tmpfiles.append(f)
                 shutil.copy2(p, f)
-                strip(f)
+                if may_strip(f):
+                    strip(f)
             subprocess.call(['lipo', '-create'] + tmpfiles + ['-output', dest])
         finally:
             for f in tmpfiles:
                 os.unlink(f)
 
 
 class UnifiedFinder(FileFinder):
     '''
--- a/toolkit/mozapps/installer/l10n-repack.py
+++ b/toolkit/mozapps/installer/l10n-repack.py
@@ -27,16 +27,17 @@ from mozpack.chrome.manifest import (
     is_manifest,
     ManifestChrome,
     Manifest,
 )
 from mozpack.errors import errors
 from mozpack.packager.unpack import UnpackFinder
 from createprecomplete import generate_precomplete
 from argparse import ArgumentParser
+import buildconfig
 
 # Set of files or directories not listed in a chrome.manifest but that are
 # localized.
 NON_CHROME = set([
     '**/crashreporter*.ini',
     'searchplugins',
     'dictionaries',
     'hyphenation',
@@ -181,12 +182,14 @@ def main():
                         help='Directory containing the build to repack')
     parser.add_argument('l10n',
                         help='Directory containing the staged langpack')
     parser.add_argument('--non-resource', nargs='+', metavar='PATTERN',
                         default=[],
                         help='Extra files not to be considered as resources')
     args = parser.parse_args()
 
+    buildconfig.substs['USE_ELF_HACK'] = False
+    buildconfig.substs['PKG_SKIP_STRIP'] = True
     repack(args.build, args.l10n, args.non_resource)
 
 if __name__ == "__main__":
     main()
--- a/toolkit/mozapps/installer/unpack.py
+++ b/toolkit/mozapps/installer/unpack.py
@@ -1,18 +1,21 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import sys
 import os
 from mozpack.packager.unpack import unpack
+import buildconfig
 
 def main():
     if len(sys.argv) != 2:
         print >>sys.stderr, "Usage: %s directory" % \
                             os.path.basename(sys.argv[0])
         sys.exit(1)
 
+    buildconfig.substs['USE_ELF_HACK'] = False
+    buildconfig.substs['PKG_SKIP_STRIP'] = True
     unpack(sys.argv[1])
 
 if __name__ == "__main__":
     main()