Bug 1473423: Allow test symbols to be included in full symbol archive in try builds; r=ted
authorAaron Klotz <aklotz@mozilla.com>
Wed, 11 Jul 2018 17:38:37 -0600
changeset 483760 3268a54a7fab9e9565038d589229e9f2bf1cdff9
parent 483759 13baffe17d22419146e4a8e42712f0cd679fc26e
child 483761 707eaef32a63301c8357a97297192327b9320764
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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 1473423: Allow test symbols to be included in full symbol archive in try builds; r=ted This patch moves the logic for include/exclude/compress from the makefile into symbols_archive.py, and adds an additional check to the full-archive case to allow the inclusion of test symbols in try builds.
--- a/Makefile.in
+++ b/Makefile.in
@@ -264,26 +264,23 @@ ifndef MOZ_AUTOMATION
 prepsymbolsarchive: recurse_syms
 .PHONY: symbolsfullarchive
 symbolsfullarchive: prepsymbolsarchive
 	$(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' \
                                      $(abspath $(DIST)/crashreporter-symbols) \
-                                     --exclude '*test*' \
-                                     --exclude '*Test*' \
-                                     --compress '**/*.sym')
+                                     --full-archive)
 .PHONY: symbolsarchive
 symbolsarchive: prepsymbolsarchive
 	$(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
-                                     $(abspath $(DIST)/crashreporter-symbols) \
-                                     --include '**/*.sym')
+                                     $(abspath $(DIST)/crashreporter-symbols))
 buildsymbols: symbolsfullarchive symbolsarchive
--- a/python/mozbuild/mozbuild/action/symbols_archive.py
+++ b/python/mozbuild/mozbuild/action/symbols_archive.py
@@ -7,38 +7,45 @@ from __future__ import absolute_import, 
 import argparse
 import sys
 import os
 from mozpack.files import FileFinder
 from mozpack.mozjar import JarWriter
 import mozpack.path as mozpath
-def make_archive(archive_name, base, exclude, include, compress):
+def make_archive(archive_name, base, exclude, include):
+    compress = ['**/*.sym']
     finder = FileFinder(base, ignore=exclude)
     if not include:
         include = ['*']
-    if not compress:
-        compress = ['**/*.sym']
     archive_basename = os.path.basename(archive_name)
     with open(archive_name, 'wb') as fh:
         with JarWriter(fileobj=fh, optimize=False, compress_level=5) as writer:
             for pat in include:
                 for p, f in finder.find(pat):
                     print('  Adding to "%s":\n\t"%s"' % (archive_basename, p))
                     should_compress = any(mozpath.match(p, pat) for pat in compress)
                     writer.add(p.encode('utf-8'), f, mode=f.mode,
                                compress=should_compress, skip_duplicates=True)
 def main(argv):
     parser = argparse.ArgumentParser(description='Produce a symbols archive')
     parser.add_argument('archive', help='Which archive to generate')
     parser.add_argument('base', help='Base directory to package')
-    parser.add_argument('--exclude', default=[], action='append', help='File patterns to exclude')
-    parser.add_argument('--include', default=[], action='append', help='File patterns to include')
-    parser.add_argument('--compress', default=[], action='append', help='File patterns to compress')
+    parser.add_argument('--full-archive', action='store_true', help='Generate a full symbol archive')
     args = parser.parse_args(argv)
-    make_archive(args.archive, args.base, args.exclude, args.include, args.compress)
+    excludes = []
+    includes = []
+    if args.full_archive:
+        # We allow symbols for tests to be included when building on try
+        if os.environ.get('MH_BRANCH', 'unknown') != 'try':
+            excludes = ['*test*', '*Test*']
+    else:
+        includes = ['**/*.sym']
+    make_archive(args.archive, args.base, excludes, includes)
 if __name__ == '__main__':