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

Unified Diff: tools/mb/mb.py

Issue 2443643002: MB: Add --isolate-map-file flag for overriding default isolate map. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | tools/mb/mb_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/mb/mb.py
diff --git a/tools/mb/mb.py b/tools/mb/mb.py
index c90c5b925f54bbac81f6cbd6e29c235ecbfd7e26..89f5c41081068dfc6b283a9e8f3ab4759753954b 100755
--- a/tools/mb/mb.py
+++ b/tools/mb/mb.py
@@ -45,6 +45,8 @@ class MetaBuildWrapper(object):
self.chromium_src_dir = CHROMIUM_SRC_DIR
self.default_config = os.path.join(self.chromium_src_dir, 'tools', 'mb',
'mb_config.pyl')
+ self.default_isolate_map = os.path.join(self.chromium_src_dir, 'testing',
+ 'buildbot', 'gn_isolate_map.pyl')
self.executable = sys.executable
self.platform = sys.platform
self.sep = os.sep
@@ -85,7 +87,11 @@ class MetaBuildWrapper(object):
subp.add_argument('-f', '--config-file', metavar='PATH',
default=self.default_config,
help='path to config file '
- '(default is //tools/mb/mb_config.pyl)')
+ '(default is %(default)s)')
+ subp.add_argument('-i', '--isolate-map-file', metavar='PATH',
+ default=self.default_isolate_map,
+ help='path to isolate map file '
+ '(default is %(default)s)')
subp.add_argument('-g', '--goma-dir',
help='path to goma directory')
subp.add_argument('--gyp-script', metavar='PATH',
@@ -126,8 +132,7 @@ class MetaBuildWrapper(object):
'each builder as a JSON object')
subp.add_argument('-f', '--config-file', metavar='PATH',
default=self.default_config,
- help='path to config file '
- '(default is //tools/mb/mb_config.pyl)')
+ help='path to config file (default is %(default)s)')
subp.add_argument('-g', '--goma-dir',
help='path to goma directory')
subp.set_defaults(func=self.CmdExport)
@@ -203,16 +208,14 @@ class MetaBuildWrapper(object):
help='validate the config file')
subp.add_argument('-f', '--config-file', metavar='PATH',
default=self.default_config,
- help='path to config file '
- '(default is //tools/mb/mb_config.pyl)')
+ help='path to config file (default is %(default)s)')
subp.set_defaults(func=self.CmdValidate)
subp = subps.add_parser('audit',
help='Audit the config file to track progress')
subp.add_argument('-f', '--config-file', metavar='PATH',
default=self.default_config,
- help='path to config file '
- '(default is //tools/mb/mb_config.pyl)')
+ help='path to config file (default is %(default)s)')
subp.add_argument('-i', '--internal', action='store_true',
help='check internal masters also')
subp.add_argument('-m', '--master', action='append',
@@ -671,8 +674,14 @@ class MetaBuildWrapper(object):
self.mixins = contents['mixins']
def ReadIsolateMap(self):
- return ast.literal_eval(self.ReadFile(self.PathJoin(
- self.chromium_src_dir, 'testing', 'buildbot', 'gn_isolate_map.pyl')))
+ if not self.Exists(self.args.isolate_map_file):
+ raise MBErr('isolate map file not found at %s' %
+ self.args.isolate_map_file)
+ try:
+ return ast.literal_eval(self.ReadFile(self.args.isolate_map_file))
+ except SyntaxError as e:
+ raise MBErr('Failed to parse isolate map file "%s": %s' %
+ (self.args.isolate_map_file, e))
def ConfigFromArgs(self):
if self.args.config:
« no previous file with comments | « no previous file | tools/mb/mb_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698