Bug 1651680 - Replace PKG_SKIP_STRIP with PKG_STRIP. r=nalexander, a=RyanVM
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Aug 2020 02:44:17 +0000
changeset 600006 0af3b12bc9a079c6ea1237e45a461b8752c59c8f
parent 600005 4258220f507e950570f039ff6e8722ccff1f6877
child 600007 3ce564d77e5f4acd0f53241c0652af470ed2ffdb
push id58
push userryanvm@gmail.com
push dateThu, 13 Aug 2020 21:28:01 +0000
treeherdermozilla-esr78@4926d2fb2493 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander, RyanVM
bugs1651680
milestone78.2.0
Bug 1651680 - Replace PKG_SKIP_STRIP with PKG_STRIP. r=nalexander, a=RyanVM Differential Revision: https://phabricator.services.mozilla.com/D86648
moz.configure
python/mozbuild/mozpack/executables.py
testing/testsuite-targets.mk
toolkit/mozapps/installer/l10n-repack.py
toolkit/mozapps/installer/strip.py
toolkit/mozapps/installer/unpack.py
--- a/moz.configure
+++ b/moz.configure
@@ -677,23 +677,17 @@ def may_strip(compile_environment, targe
 
 js_option('--enable-strip', when=may_strip, help='Enable stripping of libs & executables')
 
 set_config('ENABLE_STRIP', True, when='--enable-strip')
 
 js_option('--disable-install-strip', when=may_strip,
           help='Enable stripping of libs & executables when packaging')
 
-# The nested depends is because depending on --enable-install-strip needs the
-# `when=may_strip`, but we also need to test when may_strip is False.
-@depends(depends('--enable-install-strip', when=may_strip)(lambda x: x), may_strip)
-def pkg_skip_strip(install_strip, may_strip):
-    return not install_strip or not may_strip
-
-set_config('PKG_SKIP_STRIP', True, when=pkg_skip_strip)
+set_config('PKG_STRIP', True, when='--enable-install-strip')
 
 
 @depends('--enable-strip', '--enable-install-strip', when=may_strip)
 def strip(strip, install_strip):
     return strip or install_strip
 
 js_option(env='STRIP_FLAGS', nargs=1, when=strip, help='Flags for the strip command')
 
--- a/python/mozbuild/mozpack/executables.py
+++ b/python/mozbuild/mozpack/executables.py
@@ -81,17 +81,17 @@ def is_executable(path):
     return get_type(path) != UNKNOWN
 
 
 def may_strip(path):
     '''
     Return whether strip() should be called
     '''
     from buildconfig import substs
-    return not substs.get('PKG_SKIP_STRIP')
+    return bool(substs.get('PKG_STRIP'))
 
 
 def strip(path):
     '''
     Execute the STRIP command with STRIP_FLAGS on the given path.
     '''
     from buildconfig import substs
     strip = substs['STRIP']
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -190,17 +190,17 @@ stage-mach: make-stage-dir
 
 stage-mochitest: make-stage-dir ;
 
 stage-jstests: make-stage-dir
 	$(MAKE) -C $(DEPTH)/js/src/tests stage-package
 
 ifdef OBJCOPY
 ifneq ($(OBJCOPY), :) # see build/autoconf/toolchain.m4:102 for why this is necessary
-ifndef PKG_SKIP_STRIP
+ifdef PKG_STRIP
 STRIP_COMPILED_TESTS := 1
 endif
 endif
 endif
 
 stage-gtest: make-stage-dir
 	$(NSINSTALL) -D $(PKG_STAGE)/gtest/gtest_bin/gtest
 ifdef STRIP_COMPILED_TESTS
--- a/toolkit/mozapps/installer/l10n-repack.py
+++ b/toolkit/mozapps/installer/l10n-repack.py
@@ -44,15 +44,15 @@ def main():
                              'to be considered under the given base in the '
                              'repacked build')
     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
+    buildconfig.substs['PKG_STRIP'] = False
     l10n.repack(args.build, args.l10n, extra_l10n=dict(args.extra_l10n),
                 non_resources=args.non_resource, non_chrome=NON_CHROME)
 
 
 if __name__ == "__main__":
     main()
--- a/toolkit/mozapps/installer/strip.py
+++ b/toolkit/mozapps/installer/strip.py
@@ -9,15 +9,15 @@ Strip all files that can be stripped in 
 import sys
 from mozpack.files import FileFinder
 from mozpack.copier import FileCopier
 
 def strip(dir):
     copier = FileCopier()
     # The FileFinder will give use ExecutableFile instances for files
     # that can be stripped, and copying ExecutableFiles defaults to
-    # stripping them unless buildconfig.substs['PKG_SKIP_STRIP'] is set.
+    # stripping them when buildconfig.substs['PKG_STRIP'] is set.
     for p, f in FileFinder(dir, find_executables=True):
         copier.add(p, f)
     copier.copy(dir)
 
 if __name__ == '__main__':
     strip(sys.argv[1])
--- a/toolkit/mozapps/installer/unpack.py
+++ b/toolkit/mozapps/installer/unpack.py
@@ -13,13 +13,13 @@ def main():
     parser = argparse.ArgumentParser(
         description='Unpack a Gecko-based application')
     parser.add_argument('directory', help='Location of the application')
     parser.add_argument('--omnijar', help='Name of the omnijar')
 
     options = parser.parse_args(sys.argv[1:])
 
     buildconfig.substs['USE_ELF_HACK'] = False
-    buildconfig.substs['PKG_SKIP_STRIP'] = True
+    buildconfig.substs['PKG_STRIP'] = False
     unpack(options.directory, options.omnijar)
 
 if __name__ == "__main__":
     main()