Commit 3be0014f authored by dpranke's avatar dpranke Committed by Commit bot

mb_config.pyl cleanup: remove unused dev configs from MB.

MB was originally intended to be used to manage non-bot configs
as well, but we ended up not using this. This CL removes a bunch
of associated code that was hence no longer needed.

R=jbudorick@chromium.org, kjellander@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1808093002

Cr-Commit-Position: refs/heads/master@{#381818}
parent 43f48063
...@@ -46,9 +46,6 @@ class MetaBuildWrapper(object): ...@@ -46,9 +46,6 @@ class MetaBuildWrapper(object):
self.configs = {} self.configs = {}
self.masters = {} self.masters = {}
self.mixins = {} self.mixins = {}
self.private_configs = []
self.common_dev_configs = []
self.unsupported_configs = []
def Main(self, args): def Main(self, args):
self.ParseArgs(args) self.ParseArgs(args)
...@@ -272,32 +269,11 @@ class MetaBuildWrapper(object): ...@@ -272,32 +269,11 @@ class MetaBuildWrapper(object):
# Read the file to make sure it parses. # Read the file to make sure it parses.
self.ReadConfigFile() self.ReadConfigFile()
# Figure out the whole list of configs and ensure that no config is # Build a list of all of the configs referenced by builders.
# listed in more than one category.
all_configs = {} all_configs = {}
for config in self.common_dev_configs:
all_configs[config] = 'common_dev_configs'
for config in self.private_configs:
if config in all_configs:
errs.append('config "%s" listed in "private_configs" also '
'listed in "%s"' % (config, all_configs['config']))
else:
all_configs[config] = 'private_configs'
for config in self.unsupported_configs:
if config in all_configs:
errs.append('config "%s" listed in "unsupported_configs" also '
'listed in "%s"' % (config, all_configs['config']))
else:
all_configs[config] = 'unsupported_configs'
for master in self.masters: for master in self.masters:
for builder in self.masters[master]: for config in self.masters[master].values():
config = self.masters[master][builder] all_configs[config] = master
if config in all_configs and all_configs[config] not in self.masters:
errs.append('Config "%s" used by a bot is also listed in "%s".' %
(config, all_configs[config]))
else:
all_configs[config] = master
# Check that every referenced config actually exists. # Check that every referenced config actually exists.
for config, loc in all_configs.items(): for config, loc in all_configs.items():
...@@ -568,12 +544,9 @@ class MetaBuildWrapper(object): ...@@ -568,12 +544,9 @@ class MetaBuildWrapper(object):
raise MBErr('Failed to parse config file "%s": %s' % raise MBErr('Failed to parse config file "%s": %s' %
(self.args.config_file, e)) (self.args.config_file, e))
self.common_dev_configs = contents['common_dev_configs']
self.configs = contents['configs'] self.configs = contents['configs']
self.masters = contents['masters'] self.masters = contents['masters']
self.mixins = contents['mixins'] self.mixins = contents['mixins']
self.private_configs = contents['private_configs']
self.unsupported_configs = contents['unsupported_configs']
def ConfigFromArgs(self): def ConfigFromArgs(self):
if self.args.config: if self.args.config:
......
...@@ -93,22 +93,6 @@ ...@@ -93,22 +93,6 @@
'chromeos', 'ozone', 'gn', 'release_trybot', 'chromeos', 'ozone', 'gn', 'release_trybot',
], ],
'dev_gn_debug': [
'gn', 'debug', 'shared', 'full_symbols',
],
'dev_gn_release': [
'gn', 'release', 'shared',
],
'dev_gyp_debug': [
'gyp', 'debug', 'shared', 'full_symbols',
],
'dev_gyp_release': [
'gyp', 'release', 'shared',
],
'embedded_gyp_debug_bot': [ 'embedded_gyp_debug_bot': [
'embedded', 'gyp', 'debug_bot', 'embedded', 'gyp', 'debug_bot',
], ],
...@@ -519,29 +503,6 @@ ...@@ -519,29 +503,6 @@
], ],
}, },
# This is a list of configs that do not actually exist on any bot
# but are used so commonly by devs that we must support them.
'common_dev_configs': [
'dev_gn_debug',
'dev_gn_release',
'dev_gyp_debug',
'dev_gyp_release',
],
# This is a list of configs that some private (not publicly accessible)
# bot somewhere uses and that we must support. Ideally we should actually
# have a bot for each of these on the public waterfall. Each config should
# at least have a contact listed.
'private_configs': [
],
# This is a list of configs that are not commonly used by that we should
# make some effort to support, but if it breaks that is not the end of
# the world. Each config should have a contact listed, and we expect the
# contact to be on the hook for fixing the config.
'unsupported_configs': [
],
# This is a dict mapping a given 'mixin' name to a dict of settings that # This is a dict mapping a given 'mixin' name to a dict of settings that
# mb should use. See //tools/mb/docs/user_guide.md for more information. # mb should use. See //tools/mb/docs/user_guide.md for more information.
'mixins': { 'mixins': {
...@@ -675,11 +636,6 @@ ...@@ -675,11 +636,6 @@
'gyp_defines': 'embedded=1', 'gyp_defines': 'embedded=1',
}, },
'full_symbols': {
'gn_args': 'symbol_level=2',
'gyp_defines': 'fastbuild=0',
},
'gn_linux_upload': { 'gn_linux_upload': {
'type': 'gn', 'type': 'gn',
......
...@@ -103,33 +103,31 @@ class FakeFile(object): ...@@ -103,33 +103,31 @@ class FakeFile(object):
TEST_CONFIG = """\ TEST_CONFIG = """\
{ {
'common_dev_configs': ['gn_debug'],
'configs': { 'configs': {
'gyp_rel_bot': ['gyp', 'rel', 'goma'], 'gyp_rel_bot': ['gyp', 'rel', 'goma'],
'gn_debug': ['gn', 'debug', 'goma'], 'gn_debug_goma': ['gn', 'debug', 'goma'],
'gyp_debug': ['gyp', 'debug'], 'gyp_debug': ['gyp', 'debug', 'fake_feature1'],
'gn_rel_bot': ['gn', 'rel', 'goma'], 'gn_rel_bot': ['gn', 'rel', 'goma'],
'private': ['gyp', 'rel', 'fake_feature1'], 'gyp_crosscompile': ['gyp', 'crosscompile'],
'unsupported': ['gn', 'fake_feature2'],
}, },
'masters': { 'masters': {
'chromium': {}, 'chromium': {},
'fake_master': { 'fake_master': {
'fake_builder': 'gyp_rel_bot', 'fake_builder': 'gyp_rel_bot',
'fake_gn_builder': 'gn_rel_bot', 'fake_gn_builder': 'gn_rel_bot',
'fake_gyp_crosscompile_builder': 'gyp_crosscompile',
'fake_gn_debug_builder': 'gn_debug_goma',
'fake_gyp_builder': 'gyp_debug', 'fake_gyp_builder': 'gyp_debug',
}, },
}, },
'mixins': { 'mixins': {
'crosscompile': {
'gyp_crosscompile': True,
},
'fake_feature1': { 'fake_feature1': {
'gn_args': 'enable_doom_melon=true', 'gn_args': 'enable_doom_melon=true',
'gyp_crosscompile': True,
'gyp_defines': 'doom_melon=1', 'gyp_defines': 'doom_melon=1',
}, },
'fake_feature2': {
'gn_args': 'enable_doom_melon=false',
'gyp_defaults': 'doom_melon=0',
},
'gyp': {'type': 'gyp'}, 'gyp': {'type': 'gyp'},
'gn': {'type': 'gn'}, 'gn': {'type': 'gn'},
'goma': { 'goma': {
...@@ -143,15 +141,12 @@ TEST_CONFIG = """\ ...@@ -143,15 +141,12 @@ TEST_CONFIG = """\
'gn_args': 'is_debug=true', 'gn_args': 'is_debug=true',
}, },
}, },
'private_configs': ['private'],
'unsupported_configs': ['unsupported'],
} }
""" """
TEST_BAD_CONFIG = """\ TEST_BAD_CONFIG = """\
{ {
'common_dev_configs': ['gn_rel_bot_1'],
'configs': { 'configs': {
'gn_rel_bot_1': ['gn', 'rel', 'chrome_with_codecs'], 'gn_rel_bot_1': ['gn', 'rel', 'chrome_with_codecs'],
'gn_rel_bot_2': ['gn', 'rel', 'bad_nested_config'], 'gn_rel_bot_2': ['gn', 'rel', 'bad_nested_config'],
...@@ -174,8 +169,6 @@ TEST_BAD_CONFIG = """\ ...@@ -174,8 +169,6 @@ TEST_BAD_CONFIG = """\
'gn_args': 'is_debug=false', 'gn_args': 'is_debug=false',
}, },
}, },
'private_configs': ['private'],
'unsupported_configs': ['unsupported'],
} }
""" """
...@@ -209,13 +202,13 @@ class UnitTest(unittest.TestCase): ...@@ -209,13 +202,13 @@ class UnitTest(unittest.TestCase):
mbw = self.fake_mbw(files) mbw = self.fake_mbw(files)
# The first time we run this, the build dir doesn't exist, so no clobber. # The first time we run this, the build dir doesn't exist, so no clobber.
self.check(['gen', '-c', 'gn_debug', '//out/Debug'], mbw=mbw, ret=0) self.check(['gen', '-c', 'gn_debug_goma', '//out/Debug'], mbw=mbw, ret=0)
self.assertEqual(mbw.rmdirs, []) self.assertEqual(mbw.rmdirs, [])
self.assertEqual(mbw.files['/fake_src/out/Debug/mb_type'], 'gn') self.assertEqual(mbw.files['/fake_src/out/Debug/mb_type'], 'gn')
# The second time we run this, the build dir exists and matches, so no # The second time we run this, the build dir exists and matches, so no
# clobber. # clobber.
self.check(['gen', '-c', 'gn_debug', '//out/Debug'], mbw=mbw, ret=0) self.check(['gen', '-c', 'gn_debug_goma', '//out/Debug'], mbw=mbw, ret=0)
self.assertEqual(mbw.rmdirs, []) self.assertEqual(mbw.rmdirs, [])
self.assertEqual(mbw.files['/fake_src/out/Debug/mb_type'], 'gn') self.assertEqual(mbw.files['/fake_src/out/Debug/mb_type'], 'gn')
...@@ -243,7 +236,7 @@ class UnitTest(unittest.TestCase): ...@@ -243,7 +236,7 @@ class UnitTest(unittest.TestCase):
mbw.Call = lambda cmd, env=None, buffer_output=True: ( mbw.Call = lambda cmd, env=None, buffer_output=True: (
0, 'out/Default/foo_unittests\n', '') 0, 'out/Default/foo_unittests\n', '')
self.check(['analyze', '-c', 'gn_debug', '//out/Default', self.check(['analyze', '-c', 'gn_debug_goma', '//out/Default',
'/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0) '/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0)
out = json.loads(mbw.files['/tmp/out.json']) out = json.loads(mbw.files['/tmp/out.json'])
self.assertEqual(out, { self.assertEqual(out, {
...@@ -261,7 +254,7 @@ class UnitTest(unittest.TestCase): ...@@ -261,7 +254,7 @@ class UnitTest(unittest.TestCase):
mbw = self.fake_mbw(files) mbw = self.fake_mbw(files)
mbw.Call = lambda cmd, env=None, buffer_output=True: ( mbw.Call = lambda cmd, env=None, buffer_output=True: (
0, 'out/Default/foo_unittests\n', '') 0, 'out/Default/foo_unittests\n', '')
self.check(['analyze', '-c', 'gn_debug', '//out/Default', self.check(['analyze', '-c', 'gn_debug_goma', '//out/Default',
'/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0) '/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0)
out = json.loads(mbw.files['/tmp/out.json']) out = json.loads(mbw.files['/tmp/out.json'])
self.assertEqual(out, { self.assertEqual(out, {
...@@ -283,7 +276,7 @@ class UnitTest(unittest.TestCase): ...@@ -283,7 +276,7 @@ class UnitTest(unittest.TestCase):
(1, 'The input matches no targets, configs, or files\n', ''), (1, 'The input matches no targets, configs, or files\n', ''),
] ]
self.check(['analyze', '-c', 'gn_debug', '//out/Default', self.check(['analyze', '-c', 'gn_debug_goma', '//out/Default',
'/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0) '/tmp/in.json', '/tmp/out.json'], mbw=mbw, ret=0)
out = json.loads(mbw.files['/tmp/out.json']) out = json.loads(mbw.files['/tmp/out.json'])
self.assertEqual(out, { self.assertEqual(out, {
...@@ -293,14 +286,14 @@ class UnitTest(unittest.TestCase): ...@@ -293,14 +286,14 @@ class UnitTest(unittest.TestCase):
}) })
def test_gn_gen(self): def test_gn_gen(self):
self.check(['gen', '-c', 'gn_debug', '//out/Default', '-g', '/goma'], self.check(['gen', '-c', 'gn_debug_goma', '//out/Default', '-g', '/goma'],
ret=0, ret=0,
out=('/fake_src/buildtools/linux64/gn gen //out/Default ' out=('/fake_src/buildtools/linux64/gn gen //out/Default '
'\'--args=is_debug=true use_goma=true goma_dir="/goma"\' ' '\'--args=is_debug=true use_goma=true goma_dir="/goma"\' '
'--check\n')) '--check\n'))
mbw = self.fake_mbw(win32=True) mbw = self.fake_mbw(win32=True)
self.check(['gen', '-c', 'gn_debug', '-g', 'c:\\goma', '//out/Debug'], self.check(['gen', '-c', 'gn_debug_goma', '-g', 'c:\\goma', '//out/Debug'],
mbw=mbw, ret=0, mbw=mbw, ret=0,
out=('c:\\fake_src\\buildtools\\win\\gn.exe gen //out/Debug ' out=('c:\\fake_src\\buildtools\\win\\gn.exe gen //out/Debug '
'"--args=is_debug=true use_goma=true goma_dir=\\"' '"--args=is_debug=true use_goma=true goma_dir=\\"'
...@@ -310,7 +303,7 @@ class UnitTest(unittest.TestCase): ...@@ -310,7 +303,7 @@ class UnitTest(unittest.TestCase):
def test_gn_gen_fails(self): def test_gn_gen_fails(self):
mbw = self.fake_mbw() mbw = self.fake_mbw()
mbw.Call = lambda cmd, env=None, buffer_output=True: (1, '', '') mbw.Call = lambda cmd, env=None, buffer_output=True: (1, '', '')
self.check(['gen', '-c', 'gn_debug', '//out/Default'], mbw=mbw, ret=1) self.check(['gen', '-c', 'gn_debug_goma', '//out/Default'], mbw=mbw, ret=1)
def test_gn_gen_swarming(self): def test_gn_gen_swarming(self):
files = { files = {
...@@ -328,7 +321,7 @@ class UnitTest(unittest.TestCase): ...@@ -328,7 +321,7 @@ class UnitTest(unittest.TestCase):
} }
mbw = self.fake_mbw(files) mbw = self.fake_mbw(files)
self.check(['gen', self.check(['gen',
'-c', 'gn_debug', '-c', 'gn_debug_goma',
'--swarming-targets-file', '/tmp/swarming_targets', '--swarming-targets-file', '/tmp/swarming_targets',
'//out/Default'], mbw=mbw, ret=0) '//out/Default'], mbw=mbw, ret=0)
self.assertIn('/fake_src/out/Default/base_unittests.isolate', self.assertIn('/fake_src/out/Default/base_unittests.isolate',
...@@ -349,8 +342,8 @@ class UnitTest(unittest.TestCase): ...@@ -349,8 +342,8 @@ class UnitTest(unittest.TestCase):
"base_unittests\n" "base_unittests\n"
), ),
} }
self.check(['isolate', '-c', 'gn_debug', '//out/Default', 'base_unittests'], self.check(['isolate', '-c', 'gn_debug_goma', '//out/Default',
files=files, ret=0) 'base_unittests'], files=files, ret=0)
# test running isolate on an existing build_dir # test running isolate on an existing build_dir
files['/fake_src/out/Default/args.gn'] = 'is_debug = True\n' files['/fake_src/out/Default/args.gn'] = 'is_debug = True\n'
...@@ -374,11 +367,11 @@ class UnitTest(unittest.TestCase): ...@@ -374,11 +367,11 @@ class UnitTest(unittest.TestCase):
"base_unittests\n" "base_unittests\n"
), ),
} }
self.check(['run', '-c', 'gn_debug', '//out/Default', 'base_unittests'], self.check(['run', '-c', 'gn_debug_goma', '//out/Default',
files=files, ret=0) 'base_unittests'], files=files, ret=0)
def test_gn_lookup(self): def test_gn_lookup(self):
self.check(['lookup', '-c', 'gn_debug'], ret=0) self.check(['lookup', '-c', 'gn_debug_goma'], ret=0)
def test_gn_lookup_goma_dir_expansion(self): def test_gn_lookup_goma_dir_expansion(self):
self.check(['lookup', '-c', 'gn_rel_bot', '-g', '/foo'], ret=0, self.check(['lookup', '-c', 'gn_rel_bot', '-g', '/foo'], ret=0,
...@@ -388,13 +381,13 @@ class UnitTest(unittest.TestCase): ...@@ -388,13 +381,13 @@ class UnitTest(unittest.TestCase):
def test_gyp_analyze(self): def test_gyp_analyze(self):
mbw = self.check(['analyze', '-c', 'gyp_rel_bot', '//out/Release', mbw = self.check(['analyze', '-c', 'gyp_rel_bot', '//out/Release',
'/tmp/in.json', '/tmp/out.json'], '/tmp/in.json', '/tmp/out.json'], ret=0)
ret=0)
self.assertIn('analyzer', mbw.calls[0]) self.assertIn('analyzer', mbw.calls[0])
def test_gyp_crosscompile(self): def test_gyp_crosscompile(self):
mbw = self.fake_mbw() mbw = self.fake_mbw()
self.check(['gen', '-c', 'private', '//out/Release'], mbw=mbw, ret=0) self.check(['gen', '-c', 'gyp_crosscompile', '//out/Release'],
mbw=mbw, ret=0)
self.assertTrue(mbw.cross_compile) self.assertTrue(mbw.cross_compile)
def test_gyp_gen(self): def test_gyp_gen(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment