Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Unified Diff: scripts/slave/zip_build.py

Issue 2128613005: Archive Linux perf builds for manual bisect (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Archive Linux perf builds for manual bisect Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: scripts/slave/zip_build.py
diff --git a/scripts/slave/zip_build.py b/scripts/slave/zip_build.py
index c02908bd4aac99a1520b69ae3689872ab78127eb..440f774c768c9c99a10536785be151e15e3430f3 100755
--- a/scripts/slave/zip_build.py
+++ b/scripts/slave/zip_build.py
@@ -166,16 +166,19 @@ def WriteRevisionFile(dirname, build_revision):
except IOError:
print 'Writing to revision file in %s failed.' % dirname
-
def MakeUnversionedArchive(build_dir, staging_dir, zip_file_list,
- zip_file_name):
+ zip_file_name, strip_files=None):
"""Creates an unversioned full build archive.
Returns the path of the created archive."""
+ if strip_files:
+ strip_files = [f.strip() for f in csv.reader([strip_files]).next()]
dtu 2016/08/05 21:06:19 might be more readable to do strip_files.split(','
miimnk 2016/08/08 22:41:32 Done.
(zip_dir, zip_file) = chromium_utils.MakeZip(staging_dir,
zip_file_name,
zip_file_list,
build_dir,
- raise_error=True)
+ raise_error=True,
+ strip_files=strip_files)
+
chromium_utils.RemoveDirectory(zip_dir)
if not os.path.exists(zip_file):
raise StagingError('Failed to make zip package %s' % zip_file)
@@ -260,6 +263,7 @@ class PathMatcher(object):
self.regex_whitelist = FileRegexWhitelist(options)
self.regex_blacklist = FileRegexBlacklist(options)
self.exclude_unmatched = options.exclude_unmatched
+ self.ignore_regex = options.ignore_regex
def __str__(self):
return '\n '.join([
@@ -268,13 +272,17 @@ class PathMatcher(object):
'Exclusions: %s' % self.exclusions,
"Whitelist regex: '%s'" % self.regex_whitelist,
"Blacklist regex: '%s'" % self.regex_blacklist,
- 'Zip unmatched files: %s' % (not self.exclude_unmatched)])
+ 'Zip unmatched files: %s' % (not self.exclude_unmatched),
+ 'Ignore regex matches: %s' % (self.ignore_regex)])
dtu 2016/08/05 21:06:19 style nit: unnecessary parentheses
miimnk 2016/08/08 22:41:32 Done.
+
def Match(self, filename):
if filename in self.inclusions:
return True
if filename in self.exclusions:
return False
+ if self.ignore_regex:
+ return False
if re.match(self.regex_whitelist, filename):
return True
if re.match(self.regex_blacklist, filename):
@@ -286,10 +294,8 @@ def Archive(options):
build_dir = build_directory.GetBuildOutputDirectory(
options.src_dir, options.cros_board)
build_dir = os.path.abspath(os.path.join(build_dir, options.target))
-
staging_dir = slave_utils.GetStagingDir(options.src_dir)
chromium_utils.MakeParentDirectoriesWorldReadable(staging_dir)
-
if not options.build_revision:
(build_revision, webkit_revision) = slave_utils.GetBuildRevisions(
options.src_dir, options.webkit_dir, options.revision_dir)
@@ -352,7 +358,8 @@ def Archive(options):
zip_file_list.extend(mojom_files)
zip_file = MakeUnversionedArchive(build_dir, staging_dir, zip_file_list,
- unversioned_base_name)
+ unversioned_base_name,
+ strip_files=options.strip_files)
zip_base, zip_ext, versioned_file = MakeVersionedArchive(
zip_file, version_suffix, options)
@@ -399,6 +406,8 @@ def main(argv):
option_parser.add_option('--include-files', default='',
help='Comma separated list of files that should '
'always be included in the zip.')
+ option_parser.add_option('--ignore_regex', action='store_true',
dtu 2016/08/05 21:06:19 Command-line args should be separated by - instead
miimnk 2016/08/08 22:41:30 Done.
+ default=False, help='Ignores regex matches')
option_parser.add_option('--master-name', help='Name of the buildbot master.')
option_parser.add_option('--slave-name', help='Name of the buildbot slave.')
option_parser.add_option('--build-number', type=int,
@@ -430,6 +439,9 @@ def main(argv):
default=False, help='Add also dSYM files.')
option_parser.add_option('--append-deps-patch-sha', action='store_true')
option_parser.add_option('--gs-acl')
+ option_parser.add_option('--strip_files', default='',
+ help='Comma separated list of files that should '
+ 'be stripped of symbols in the zip.')
dtu 2016/08/05 21:06:19 I'd prefer if you convert the argument to a list i
miimnk 2016/08/08 22:41:31 Done.
option_parser.add_option('--json-urls',
help=('Path to json file containing uploaded '
'archive urls. If this is omitted then '

Powered by Google App Engine
This is Rietveld 408576698