summaryrefslogtreecommitdiffstats
path: root/tools/mb
diff options
context:
space:
mode:
authordpranke <dpranke@chromium.org>2015-09-15 17:16:19 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-16 00:17:34 +0000
commitfae80e312dba6818315f4f8f0c3a1d85f6f4f9fb (patch)
tree5eaf56f6b8cb0a8a6ac2e1b7bcec6d2400402ec1 /tools/mb
parent4ce74f798e6e7c6fd944cf03aa0c6e69c427a736 (diff)
downloadchromium_src-fae80e312dba6818315f4f8f0c3a1d85f6f4f9fb.zip
chromium_src-fae80e312dba6818315f4f8f0c3a1d85f6f4f9fb.tar.gz
chromium_src-fae80e312dba6818315f4f8f0c3a1d85f6f4f9fb.tar.bz2
Remove the 'gyp_config' concept from MB.
Previously MB would try to ensure that the build directory passed to it matched the expected gyp configuration for the bot (i.e. that we would not pass "//out/Debug" as a path for a release bot). Making this work correctly was awkward for the Win x64 bots (which use Release_x64 instead of Release), and it's not clear that this check would ever actually catch a real problem. So, this patch deletes all of the 'gyp_config' logic instead and simplifies things. TBR=scottmg@chromium.org BUG=481692 Review URL: https://codereview.chromium.org/1348463002 Cr-Commit-Position: refs/heads/master@{#349043}
Diffstat (limited to 'tools/mb')
-rw-r--r--tools/mb/docs/user_guide.md7
-rwxr-xr-xtools/mb/mb.py39
-rw-r--r--tools/mb/mb_config.pyl3
-rwxr-xr-xtools/mb/mb_unittest.py4
4 files changed, 12 insertions, 41 deletions
diff --git a/tools/mb/docs/user_guide.md b/tools/mb/docs/user_guide.md
index e1aba6f..6185d9e 100644
--- a/tools/mb/docs/user_guide.md
+++ b/tools/mb/docs/user_guide.md
@@ -172,8 +172,6 @@ value of the `mixins` key.
Each mixin value is itself a dictionary that contains one or more of the
following keys:
- * `gyp_configs`: a list of the configurations to build, e.g.,
- ['Release', 'Release_x64'].
* `gyp_crosscompile`: a boolean; if true, GYP_CROSSCOMPILE=1 is set in
the environment and passed to GYP.
* `gyp_defines`: a string containing a list of GYP_DEFINES.
@@ -184,8 +182,8 @@ following keys:
When `mb gen` or `mb analyze` executes, it takes a config name, looks it
up in the 'configs' dict, and then does a left-to-right expansion of the
-mixins; gyp_defines and gn_args values are concatenated, and type and
-gyp_configs values override each other.
+mixins; gyp_defines and gn_args values are concatenated, and the type values
+overrides each other.
For example, if you had:
@@ -205,7 +203,6 @@ For example, if you had:
},
'gn': {'type': 'gn'},
'gyp_release': {
- 'gyp_config': 'Release'
'mixins': ['release'],
'type': 'gyp',
},
diff --git a/tools/mb/mb.py b/tools/mb/mb.py
index b4f7e77..507fba0 100755
--- a/tools/mb/mb.py
+++ b/tools/mb/mb.py
@@ -146,7 +146,7 @@ class MetaBuildWrapper(object):
elif vals['type'] == 'gyp':
if vals['gyp_crosscompile']:
self.Print('GYP_CROSSCOMPILE=1')
- cmd = self.GYPCmd('<path>', vals['gyp_defines'], vals['gyp_config'])
+ cmd = self.GYPCmd('<path>', vals['gyp_defines'])
else:
raise MBErr('Unknown meta-build type "%s"' % vals['type'])
@@ -285,7 +285,6 @@ class MetaBuildWrapper(object):
vals = {
'type': None,
'gn_args': [],
- 'gyp_config': [],
'gyp_defines': '',
'gyp_crosscompile': False,
}
@@ -311,8 +310,6 @@ class MetaBuildWrapper(object):
vals['gn_args'] += ' ' + mixin_vals['gn_args']
else:
vals['gn_args'] = mixin_vals['gn_args']
- if 'gyp_config' in mixin_vals:
- vals['gyp_config'] = mixin_vals['gyp_config']
if 'gyp_crosscompile' in mixin_vals:
vals['gyp_crosscompile'] = mixin_vals['gyp_crosscompile']
if 'gyp_defines' in mixin_vals:
@@ -458,12 +455,8 @@ class MetaBuildWrapper(object):
def RunGYPGen(self, vals):
path = self.args.path[0]
- output_dir, gyp_config = self.ParseGYPConfigPath(path)
- if gyp_config != vals['gyp_config']:
- raise MBErr('The last component of the path (%s) must match the '
- 'GYP configuration specified in the config (%s), and '
- 'it does not.' % (gyp_config, vals['gyp_config']))
- cmd = self.GYPCmd(output_dir, vals['gyp_defines'], config=gyp_config)
+ output_dir = self.ParseGYPConfigPath(path)
+ cmd = self.GYPCmd(output_dir, vals['gyp_defines'])
env = None
if vals['gyp_crosscompile']:
if self.args.verbose:
@@ -474,11 +467,7 @@ class MetaBuildWrapper(object):
return ret
def RunGYPAnalyze(self, vals):
- output_dir, gyp_config = self.ParseGYPConfigPath(self.args.path[0])
- if gyp_config != vals['gyp_config']:
- raise MBErr('The last component of the path (%s) must match the '
- 'GYP configuration specified in the config (%s), and '
- 'it does not.' % (gyp_config, vals['gyp_config']))
+ output_dir = self.ParseGYPConfigPath(self.args.path[0])
if self.args.verbose:
inp = self.ReadInputJSON(['files', 'targets'])
self.Print()
@@ -486,7 +475,7 @@ class MetaBuildWrapper(object):
self.PrintJSON(inp)
self.Print()
- cmd = self.GYPCmd(output_dir, vals['gyp_defines'], config=gyp_config)
+ cmd = self.GYPCmd(output_dir, vals['gyp_defines'])
cmd.extend(['-f', 'analyzer',
'-G', 'config_path=%s' % self.args.input_path[0],
'-G', 'analyzer_output_path=%s' % self.args.output_path[0]])
@@ -592,26 +581,16 @@ class MetaBuildWrapper(object):
def ParseGYPConfigPath(self, path):
rpath = self.ToSrcRelPath(path)
- output_dir, _, config = rpath.rpartition('/')
- self.CheckGYPConfigIsSupported(config, path)
- return output_dir, config
-
- def CheckGYPConfigIsSupported(self, config, path):
- if config not in ('Debug', 'Release'):
- if (sys.platform in ('win32', 'cygwin') and
- config not in ('Debug_x64', 'Release_x64')):
- raise MBErr('Unknown or unsupported config type "%s" in "%s"' %
- config, path)
-
- def GYPCmd(self, output_dir, gyp_defines, config):
+ output_dir, _, _ = rpath.rpartition('/')
+ return output_dir
+
+ def GYPCmd(self, output_dir, gyp_defines):
gyp_defines = gyp_defines.replace("$(goma_dir)", self.args.goma_dir)
cmd = [
sys.executable,
os.path.join('build', 'gyp_chromium'),
'-G',
'output_dir=' + output_dir,
- '-G',
- 'config=' + config,
]
for d in shlex.split(gyp_defines):
cmd += ['-D', d]
diff --git a/tools/mb/mb_config.pyl b/tools/mb/mb_config.pyl
index a233b22..f4c0361 100644
--- a/tools/mb/mb_config.pyl
+++ b/tools/mb/mb_config.pyl
@@ -159,7 +159,6 @@
'debug': {
'gn_args': 'is_debug=true',
- 'gyp_config': 'Debug',
},
'debug_bot': {
@@ -254,12 +253,10 @@
'official': {
'gn_args': 'is_chrome_branded is_official_build=true is_debug=false is_component_build=false',
'gyp_defines': 'branding="Chrome" buildtype="Official" component=static_library',
- 'gyp_config': 'Release',
},
'release': {
'gn_args': 'is_debug=false',
- 'gyp_config': 'Release',
},
'release_bot': {
diff --git a/tools/mb/mb_unittest.py b/tools/mb/mb_unittest.py
index 8c76e50..a6f2789 100755
--- a/tools/mb/mb_unittest.py
+++ b/tools/mb/mb_unittest.py
@@ -121,11 +121,9 @@ TEST_CONFIG = """\
},
'rel': {
'gn_args': 'is_debug=false',
- 'gyp_config': 'Release',
},
'debug': {
'gn_args': 'is_debug=true',
- 'gyp_config': 'Debug',
},
},
'private_configs': ['private'],
@@ -304,7 +302,7 @@ class UnitTest(unittest.TestCase):
def test_gyp_lookup_goma_dir_expansion(self):
self.check(['lookup', '-c', 'gyp_rel_bot', '-g', '/foo'], ret=0,
out=("python build/gyp_chromium -G 'output_dir=<path>' "
- "-G config=Release -D goma=1 -D gomadir=/foo\n"))
+ "-D goma=1 -D gomadir=/foo\n"))
def test_help(self):
orig_stdout = sys.stdout