Bug 1307886 - [1.2] Remove szip support. r=glandium
authorEugen Sawin <esawin@mozilla.com>
Tue, 18 Oct 2016 17:45:10 +0200
changeset 362779 ff6f8253d511b7c11b180c386236392ddbc48739
parent 362778 bcd70451dd158b5b9d1a6b3435b14866f5a8f8de
child 362780 a4e85e8b39695146370873efafee0f881c565e81
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1307886
milestone52.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 1307886 - [1.2] Remove szip support. r=glandium
mobile/android/config/mozconfigs/common
old-configure.in
python/mozbuild/mozbuild/action/package_fennec_apk.py
testing/remotecppunittests.py
testing/testsuite-targets.mk
testing/xpcshell/remotexpcshelltests.py
toolkit/mozapps/installer/upload-files-APK.mk
--- a/mobile/android/config/mozconfigs/common
+++ b/mobile/android/config/mozconfigs/common
@@ -20,21 +20,16 @@ if [ ! -f /etc/redhat-release ] || [ "$(
     # see taskcluster/scripts/misc/repackage-jdk.sh
     export JAVA_HOME="$topsrcdir/java_home"
     export PATH="$PATH:$topsrcdir/java_home/bin"
 
     mk_add_options "export JAVA_HOME=$topsrcdir/java_home"
     mk_add_options "export PATH=$PATH:$topsrcdir/java_home/bin"
 fi
 
-# Set the most aggressive settings for szip. Not the default because it's
-# much slower and we didn't want to slow down developers builds.
-# Has no effect when MOZ_ENABLE_SZIP is not set in mobile/android/confvars.sh.
-MOZ_SZIP_FLAGS="-D auto -f auto"
-
 ac_add_options --enable-elf-hack
 
 ANDROID_NDK_VERSION="r10e"
 ANDROID_NDK_VERSION_32BIT="r8c"
 
 # Build Fennec
 ac_add_options --enable-application=mobile/android
 ac_add_options --with-android-sdk="$topsrcdir/android-sdk-linux"
--- a/old-configure.in
+++ b/old-configure.in
@@ -5738,19 +5738,16 @@ AC_SUBST(MOZ_LIBAV_FFT)
 AC_SUBST_LIST(LIBAV_FFT_ASFLAGS)
 AC_SUBST(MOZ_DEVTOOLS)
 
 AC_SUBST(MOZ_PACKAGE_JSSHELL)
 AC_SUBST(MOZ_FOLD_LIBS)
 AC_SUBST(MOZ_FOLD_LIBS_FLAGS)
 AC_SUBST(SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE)
 
-AC_SUBST(MOZ_ENABLE_SZIP)
-AC_SUBST(MOZ_SZIP_FLAGS)
-
 AC_SUBST(DMG_TOOL)
 
 dnl Host JavaScript runtime, if any, to use during cross compiles.
 AC_SUBST(JS_BINARY)
 
 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
 
 if test -n "$COMPILE_ENVIRONMENT"; then
--- a/python/mozbuild/mozbuild/action/package_fennec_apk.py
+++ b/python/mozbuild/mozbuild/action/package_fennec_apk.py
@@ -23,17 +23,16 @@ from mozpack.files import (
 from mozpack.mozjar import JarReader
 import mozpack.path as mozpath
 
 
 def package_fennec_apk(inputs=[], omni_ja=None, classes_dex=None,
                        lib_dirs=[],
                        assets_dirs=[],
                        features_dirs=[],
-                       szip_assets_libs_with=None,
                        root_files=[],
                        verbose=False):
     jarrer = Jarrer(optimize=False)
 
     # First, take input files.  The contents of the later files overwrites the
     # content of earlier files.
     for input in inputs:
         jar = JarReader(input)
@@ -60,27 +59,16 @@ def package_fennec_apk(inputs=[], omni_j
             add(mozpath.join('assets', 'features', p), f, False)
 
     for assets_dir in assets_dirs:
         finder = FileFinder(assets_dir, find_executables=False)
         for p, f in finder.find('**'):
             compress = None  # Take default from Jarrer.
             if p.endswith('.so'):
                 # Asset libraries are special.
-                if szip_assets_libs_with:
-                    # We need to szip libraries before packing.  The file
-                    # returned by the finder is not yet opened.  When it is
-                    # opened, it will "see" the content updated by szip.
-                    subprocess.check_output([szip_assets_libs_with,
-                                             mozpath.join(finder.base, p)])
-
-                if f.open().read(4) == 'SeZz':
-                    # We need to store (rather than deflate) szipped libraries
-                    # (even if we don't szip them ourselves).
-                    compress = False
             add(mozpath.join('assets', p), f, compress=compress)
 
     for lib_dir in lib_dirs:
         finder = FileFinder(lib_dir, find_executables=False)
         for p, f in finder.find('**'):
             add(mozpath.join('lib', p), f)
 
     for root_file in root_files:
@@ -108,34 +96,30 @@ def main(args):
     parser.add_argument('--classes-dex', default=None,
                         help='Optional classes.dex to pack into APK file.')
     parser.add_argument('--lib-dirs', nargs='*', default=[],
                         help='Optional lib/ dirs to pack into APK file.')
     parser.add_argument('--assets-dirs', nargs='*', default=[],
                         help='Optional assets/ dirs to pack into APK file.')
     parser.add_argument('--features-dirs', nargs='*', default=[],
                         help='Optional features/ dirs to pack into APK file.')
-    parser.add_argument('--szip-assets-libs-with', default=None,
-                        help='IN PLACE szip assets/**/*.so BEFORE packing '
-                        'into APK file using the given szip executable.')
     parser.add_argument('--root-files', nargs='*', default=[],
                         help='Optional files to pack into APK file root.')
     args = parser.parse_args(args)
 
     if buildconfig.substs.get('OMNIJAR_NAME') != 'assets/omni.ja':
         raise ValueError("Don't know how package Fennec APKs when "
                          " OMNIJAR_NAME is not 'assets/omni.jar'.")
 
     jarrer = package_fennec_apk(inputs=args.inputs,
                                 omni_ja=args.omnijar,
                                 classes_dex=args.classes_dex,
                                 lib_dirs=args.lib_dirs,
                                 assets_dirs=args.assets_dirs,
                                 features_dirs=args.features_dirs,
-                                szip_assets_libs_with=args.szip_assets_libs_with,
                                 root_files=args.root_files,
                                 verbose=args.verbose)
     jarrer.copy(args.output)
 
     return 0
 
 
 if __name__ == '__main__':
--- a/testing/remotecppunittests.py
+++ b/testing/remotecppunittests.py
@@ -47,77 +47,45 @@ class RemoteCPPUnitTests(cppunittests.CP
         if self.device.dirExists(self.remote_home_dir):
             self.device.removeDir(self.remote_home_dir)
         self.device.mkDir(self.remote_home_dir)
         self.push_libs()
         self.push_progs(progs)
         self.device.chmodDir(self.remote_bin_dir)
 
     def push_libs(self):
-        if self.options.local_bin is not None:
-            szip = os.path.join(self.options.local_bin, '..', 'host', 'bin', 'szip')
-            if not os.path.exists(szip):
-                # Tinderbox builds must run szip from the test package
-                szip = os.path.join(self.options.local_bin, 'host', 'szip')
-            if not os.path.exists(szip):
-                # If the test package doesn't contain szip, it means files
-                # are not szipped in the test package.
-                szip = None
-        else:
-            szip = None
         if self.options.local_apk:
             with mozfile.TemporaryDirectory() as tmpdir:
                 apk_contents = ZipFile(self.options.local_apk)
 
                 for info in apk_contents.infolist():
                     if info.filename.endswith(".so"):
                         print >> sys.stderr, "Pushing %s.." % info.filename
                         remote_file = posixpath.join(self.remote_bin_dir, os.path.basename(info.filename))
                         apk_contents.extract(info, tmpdir)
                         local_file = os.path.join(tmpdir, info.filename)
-                        if szip:
-                            try:
-                                out = subprocess.check_output([szip, '-d', local_file], stderr=subprocess.STDOUT)
-                            except subprocess.CalledProcessError:
-                                print >> sys.stderr, "Error calling %s on %s.." % (szip, local_file)
-                                if out:
-                                    print >> sys.stderr, out
                         self.device.pushFile(local_file, remote_file)
 
         elif self.options.local_lib:
             for file in os.listdir(self.options.local_lib):
                 if file.endswith(".so"):
                     print >> sys.stderr, "Pushing %s.." % file
                     remote_file = posixpath.join(self.remote_bin_dir, file)
                     local_file = os.path.join(self.options.local_lib, file)
-                    if szip:
-                        try:
-                            out = subprocess.check_output([szip, '-d', local_file], stderr=subprocess.STDOUT)
-                        except subprocess.CalledProcessError:
-                            print >> sys.stderr, "Error calling %s on %s.." % (szip, local_file)
-                            if out:
-                                print >> sys.stderr, out
                     self.device.pushFile(local_file, remote_file)
             # Additional libraries may be found in a sub-directory such as "lib/armeabi-v7a"
             for subdir in ["assets", "lib"]:
                 local_arm_lib = os.path.join(self.options.local_lib, subdir)
                 if os.path.isdir(local_arm_lib):
                     for root, dirs, files in os.walk(local_arm_lib):
                         for file in files:
                             if (file.endswith(".so")):
                                 print >> sys.stderr, "Pushing %s.." % file
                                 remote_file = posixpath.join(self.remote_bin_dir, file)
                                 local_file = os.path.join(root, file)
-                                if szip:
-                                    try:
-                                        out = subprocess.check_output([szip, '-d', local_file], stderr=subprocess.STDOUT)
-                                    except subprocess.CalledProcessError:
-                                        print >> sys.stderr, "Error calling %s on %s.." % (szip, local_file)
-                                        if out:
-                                            print >> sys.stderr, out
                                 self.device.pushFile(local_file, remote_file)
 
     def push_progs(self, progs):
         for local_file in progs:
             remote_file = posixpath.join(self.remote_bin_dir, os.path.basename(local_file))
             self.device.pushFile(local_file, remote_file)
 
     def build_environment(self):
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -280,20 +280,16 @@ stage-gtest: make-stage-dir
 	$(NSINSTALL) -D $(PKG_STAGE)/gtest/gtest_bin
 	cp -RL $(DIST)/bin/gtest $(PKG_STAGE)/gtest/gtest_bin
 	cp -RL $(DEPTH)/_tests/gtest $(PKG_STAGE)
 	cp $(topsrcdir)/testing/gtest/rungtests.py $(PKG_STAGE)/gtest
 	cp $(DIST)/bin/dependentlibs.list.gtest $(PKG_STAGE)/gtest
 	cp $(DEPTH)/mozinfo.json $(PKG_STAGE)/gtest
 
 stage-android: make-stage-dir
-ifdef MOZ_ENABLE_SZIP
-# Tinderbox scripts are not unzipping everything, so the file needs to be in a directory it unzips
-	$(NSINSTALL) $(DIST)/host/bin/szip $(PKG_STAGE)/bin/host
-endif
 	$(NSINSTALL) $(topsrcdir)/mobile/android/fonts $(DEPTH)/_tests/reftest
 	$(NSINSTALL) $(topsrcdir)/mobile/android/fonts $(DEPTH)/_tests/testing/mochitest
 
 stage-jetpack: make-stage-dir
 	$(MAKE) -C $(DEPTH)/addon-sdk stage-tests-package
 
 CPP_UNIT_TEST_BINS=$(wildcard $(DIST)/cppunittests/*)
 
--- a/testing/xpcshell/remotexpcshelltests.py
+++ b/testing/xpcshell/remotexpcshelltests.py
@@ -438,83 +438,51 @@ class XPCShellRemote(xpcshell.XPCShellTe
 
         if self.options.localAPK:
             remoteFile = remoteJoin(self.remoteBinDir, os.path.basename(self.options.localAPK))
             self.device.pushFile(self.options.localAPK, remoteFile)
 
         self.pushLibs()
 
     def pushLibs(self):
-        if self.localBin is not None:
-            szip = os.path.join(self.localBin, '..', 'host', 'bin', 'szip')
-            if not os.path.exists(szip):
-                # Tinderbox builds must run szip from the test package
-                szip = os.path.join(self.localBin, 'host', 'szip')
-            if not os.path.exists(szip):
-                # If the test package doesn't contain szip, it means files
-                # are not szipped in the test package.
-                szip = None
-        else:
-            szip = None
         pushed_libs_count = 0
         if self.options.localAPK:
             try:
                 dir = tempfile.mkdtemp()
                 for info in self.localAPKContents.infolist():
                     if info.filename.endswith(".so"):
                         print >> sys.stderr, "Pushing %s.." % info.filename
                         remoteFile = remoteJoin(self.remoteBinDir, os.path.basename(info.filename))
                         self.localAPKContents.extract(info, dir)
                         localFile = os.path.join(dir, info.filename)
-                        if szip:
-                            try:
-                                out = subprocess.check_output([szip, '-d', localFile], stderr=subprocess.STDOUT)
-                            except subprocess.CalledProcessError:
-                                print >> sys.stderr, "Error calling %s on %s.." % (szip, localFile)
-                                if out:
-                                    print >> sys.stderr, out
                         self.device.pushFile(localFile, remoteFile)
                         pushed_libs_count += 1
             finally:
                 shutil.rmtree(dir)
             return pushed_libs_count
 
         for file in os.listdir(self.localLib):
             if (file.endswith(".so")):
                 print >> sys.stderr, "Pushing %s.." % file
                 if 'libxul' in file:
                     print >> sys.stderr, "This is a big file, it could take a while."
                 localFile = os.path.join(self.localLib, file)
                 remoteFile = remoteJoin(self.remoteBinDir, file)
-                if szip:
-                    try:
-                        out = subprocess.check_output([szip, '-d', localFile], stderr=subprocess.STDOUT)
-                    except subprocess.CalledProcessError:
-                        print >> sys.stderr, "Error calling %s on %s.." % (szip, localFile)
-                        if out:
-                            print >> sys.stderr, out
                 self.device.pushFile(localFile, remoteFile)
                 pushed_libs_count += 1
 
         # Additional libraries may be found in a sub-directory such as "lib/armeabi-v7a"
         localArmLib = os.path.join(self.localLib, "lib")
         if os.path.exists(localArmLib):
             for root, dirs, files in os.walk(localArmLib):
                 for file in files:
                     if (file.endswith(".so")):
                         print >> sys.stderr, "Pushing %s.." % file
                         localFile = os.path.join(root, file)
                         remoteFile = remoteJoin(self.remoteBinDir, file)
-                        if szip:
-                            try:
-                                out = subprocess.check_output([szip, '-d', localFile], stderr=subprocess.STDOUT)
-                            except subprocess.CalledProcessError:
-                                print >> sys.stderr, "Error calling %s on %s.." % (szip, localFile)
-                                if out:
-                                    print >> sys.stderr, out
                         self.device.pushFile(localFile, remoteFile)
                         pushed_libs_count += 1
 
         return pushed_libs_count
 
     def setupModules(self):
         if self.testingModulesDir:
             self.device.pushDir(self.testingModulesDir, self.remoteModulesDir)
--- a/toolkit/mozapps/installer/upload-files-APK.mk
+++ b/toolkit/mozapps/installer/upload-files-APK.mk
@@ -95,17 +95,16 @@ INNER_FENNEC_PACKAGE = \
     --verbose \
     --inputs \
       $(GECKO_APP_AP_PATH)/gecko-nodeps.ap_ \
     --omnijar $(STAGEPATH)$(MOZ_PKG_DIR)/$(OMNIJAR_NAME) \
     --classes-dex $(GECKO_APP_AP_PATH)/classes.dex \
     --lib-dirs $(STAGEPATH)$(MOZ_PKG_DIR)/lib \
     --assets-dirs $(STAGEPATH)$(MOZ_PKG_DIR)/assets \
     --features-dirs $(STAGEPATH)$(MOZ_PKG_DIR)/features \
-    $(if $(COMPILE_ENVIRONMENT),$(if $(MOZ_ENABLE_SZIP),--szip-assets-libs-with $(ABS_DIST)/host/bin/szip)) \
     --root-files $(foreach f,$(ROOT_FILES),$(STAGEPATH)$(MOZ_PKG_DIR)/$(f)) \
     --output $(PACKAGE:.apk=-unsigned-unaligned.apk) && \
   $(call RELEASE_SIGN_ANDROID_APK,$(PACKAGE:.apk=-unsigned-unaligned.apk),$(PACKAGE))
 
 # Packaging produces many optional artifacts.
 package_fennec = \
   $(INNER_FENNEC_PACKAGE) && \
   $(INNER_ROBOCOP_PACKAGE) && \