Bug 1346381 - Strip executables in the jsshell package. r=mshal, a=jcristau
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 14 Mar 2017 15:22:39 +0900
changeset 395177 e00635bc10f072b7ab93640a6094b3d92e8ab740
parent 395176 e49b6dacff0f16b0fb6d01a1c0bcb7b90ecff22d
child 395178 f7d0c4c627abac6162a0d96434320b1f77acc75c
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal, jcristau
bugs1346381, 1335309
milestone54.0a2
Bug 1346381 - Strip executables in the jsshell package. r=mshal, a=jcristau In bug 1335309, FileFinder was made to default to not find executables, and zip.py was made to use the default instead. Which made sense for most uses of zip.py, except for the jsshell package. So we add a flag to make zip.py able to strip executable (which happens when the FileFinder is made to find them), and use that flag for the jsshell package only.
python/mozbuild/mozbuild/action/zip.py
toolkit/mozapps/installer/upload-files.mk
--- a/python/mozbuild/mozbuild/action/zip.py
+++ b/python/mozbuild/mozbuild/action/zip.py
@@ -15,25 +15,27 @@ import argparse
 import mozpack.path as mozpath
 import sys
 
 def main(args):
     parser = argparse.ArgumentParser()
     parser.add_argument("-C", metavar='DIR', default=".",
                         help="Change to given directory before considering "
                         "other paths")
+    parser.add_argument("--strip", action='store_true',
+                        help="Strip executables")
     parser.add_argument("zip", help="Path to zip file to write")
     parser.add_argument("input", nargs="+",
                         help="Path to files to add to zip")
     args = parser.parse_args(args)
 
     jarrer = Jarrer(optimize=False)
 
     with errors.accumulate():
-        finder = FileFinder(args.C)
+        finder = FileFinder(args.C, find_executables=args.strip)
         for path in args.input:
             for p, f in finder.find(path):
                 jarrer.add(p, f)
         jarrer.copy(mozpath.join(args.C, args.zip))
 
 
 if __name__ == '__main__':
     main(sys.argv[1:])
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -71,17 +71,17 @@ ifdef MSVC_CXX_RUNTIME_DLL
   JSSHELL_BINS += $(MSVC_CXX_RUNTIME_DLL)
 endif
 
 ifdef WIN_UCRT_REDIST_DIR
   JSSHELL_BINS += $(notdir $(wildcard $(DIST)/bin/api-ms-win-*.dll))
   JSSHELL_BINS += ucrtbase.dll
 endif
 
-MAKE_JSSHELL  = $(call py_action,zip,-C $(DIST)/bin $(abspath $(PKG_JSSHELL)) $(JSSHELL_BINS))
+MAKE_JSSHELL  = $(call py_action,zip,-C $(DIST)/bin --strip $(abspath $(PKG_JSSHELL)) $(JSSHELL_BINS))
 
 JARLOG_DIR = $(topobjdir)/jarlog/
 JARLOG_FILE_AB_CD = $(JARLOG_DIR)/$(AB_CD).log
 
 TAR_CREATE_FLAGS := --exclude=.mkdir.done $(TAR_CREATE_FLAGS)
 CREATE_FINAL_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \
   --mode=go-w --exclude=.mkdir.done -f
 UNPACK_TAR       = tar -xf-