Bug 1651680 - Replace PKG_SKIP_STRIP with PKG_STRIP. r=nalexander
☠☠ backed out by eb557787e80d ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Aug 2020 00:07:02 +0000
changeset 544211 13a881966ddab89d5848c572c22634869639267c
parent 544210 206c1b453cedfa7c4badf132551f51a2e9b22df2
child 544212 09a5f4dcd92ae8a3e3526ad51fb3d32785ad6e7b
push id123893
push usermh@glandium.org
push dateTue, 11 Aug 2020 00:56:06 +0000
treeherderautoland@09a5f4dcd92a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1651680
milestone81.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 1651680 - Replace PKG_SKIP_STRIP with PKG_STRIP. r=nalexander 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
@@ -191,17 +191,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
@@ -45,15 +45,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()