Bug 1346381 - Strip executables in the jsshell package. r?mshal draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 14 Mar 2017 15:22:39 +0900
changeset 498098 ec8038c2075c30a8137dde038caf687c3155e3d6
parent 498097 ab115811036da8a7c5103acc3f5ed4bd856933a5
child 549086 62dce6d804be05fbea5e58f362da232a987abcdd
push id49113
push userbmo:mh+mozilla@glandium.org
push dateTue, 14 Mar 2017 09:54:35 +0000
reviewersmshal
bugs1346381, 1335309
milestone55.0a1
Bug 1346381 - Strip executables in the jsshell package. r?mshal 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-