Move tools/mb -> tools-webrtc/mb

In addition to moving tools/mb -> tools-webrtc/mb, also
move webrtc/build/mb_config.pyl into tools-webrtc/mb
to match the default location better.
Remove Chromium-specific check for 'mb validate' that failed
due to doing this (we never cleaned that when we forked the code).

BUG=webrtc:5006
TBR=ehmaldonado@webrtc.org
NOTRY=True
TESTED=Manually ran:
tools-webrtc/mb/mb.py gen -m client.webrtc -b 'iOS64 Release' --config-file tools-webrtc/mb/mb_config.pyl  //out/Release-iphoneos
tools-webrtc/mb/mb.py gen -m client.webrtc -b 'Mac64 Release' --config-file tools-webrtc/mb/mb_config.pyl  //out/Release-mac

Review-Url: https://codereview.webrtc.org/2585743002 .
Cr-Commit-Position: refs/heads/master@{#15664}
This commit is contained in:
Henrik Kjellander 2016-12-18 22:14:50 +01:00
parent b4ad603b47
commit b2d5577caf
13 changed files with 7 additions and 125 deletions

View file

@ -459,6 +459,7 @@ def _CommonChecks(input_api, output_api):
r'^tools[\\\/]valgrind[\\\/].*\.py$',
r'^tools[\\\/]win[\\\/].*\.py$',
# TODO(phoglund): should arguably be checked.
r'^tools-webrtc[\\\/]mb[\\\/].*\.py$',
r'^tools-webrtc[\\\/]valgrind[\\\/].*\.py$',
r'^xcodebuild.*[\\\/].*\.py$',),
disabled_warnings=['F0401', # Failed to import x

View file

@ -19,11 +19,7 @@ def _CommonChecks(input_api, output_api):
input_api, output_api, '.', [ r'^.+_unittest\.py$']))
# Validate the format of the mb_config.pyl file.
mb_config_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
'..', '..', 'webrtc', 'build',
'mb_config.pyl')
cmd = [input_api.python_executable, 'mb.py', 'validate', '--config-file',
mb_config_path]
cmd = [input_api.python_executable, 'mb.py', 'validate']
kwargs = {'cwd': input_api.PresubmitLocalPath()}
results.extend(input_api.RunTests([
input_api.Command(name='mb_validate',

View file

@ -32,8 +32,8 @@ import urllib2
from collections import OrderedDict
CHROMIUM_SRC_DIR = os.path.dirname(os.path.dirname(os.path.dirname(
os.path.abspath(__file__))))
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
CHROMIUM_SRC_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR))
sys.path = [os.path.join(CHROMIUM_SRC_DIR, 'build')] + sys.path
import gn_helpers
@ -47,8 +47,7 @@ def main(args):
class MetaBuildWrapper(object):
def __init__(self):
self.chromium_src_dir = CHROMIUM_SRC_DIR
self.default_config = os.path.join(self.chromium_src_dir, 'tools', 'mb',
'mb_config.pyl')
self.default_config = os.path.join(SCRIPT_DIR, 'mb_config.pyl')
self.default_isolate_map = os.path.join(self.chromium_src_dir, 'testing',
'buildbot', 'gn_isolate_map.pyl')
self.executable = sys.executable
@ -421,29 +420,6 @@ class MetaBuildWrapper(object):
if not mixin in referenced_mixins:
errs.append('Unreferenced mixin "%s".' % mixin)
# If we're checking the Chromium config, check that the 'chromium' bots
# which build public artifacts do not include the chrome_with_codecs mixin.
if self.args.config_file == self.default_config:
if 'chromium' in self.masters:
for builder in self.masters['chromium']:
config = self.masters['chromium'][builder]
def RecurseMixins(current_mixin):
if current_mixin == 'chrome_with_codecs':
errs.append('Public artifact builder "%s" can not contain the '
'"chrome_with_codecs" mixin.' % builder)
return
if not 'mixins' in self.mixins[current_mixin]:
return
for mixin in self.mixins[current_mixin]['mixins']:
RecurseMixins(mixin)
for mixin in self.configs[config]:
RecurseMixins(mixin)
else:
errs.append('Missing "chromium" master. Please update this '
'proprietary codecs check with the name of the master '
'responsible for public build artifacts.')
if errs:
raise MBErr(('mb config file %s has problems:' % self.args.config_file) +
'\n ' + '\n '.join(errs))

View file

@ -26,7 +26,7 @@ class FakeMBW(mb.MetaBuildWrapper):
# Override vars for test portability.
if win32:
self.chromium_src_dir = 'c:\\fake_src'
self.default_config = 'c:\\fake_src\\tools\\mb\\mb_config.pyl'
self.default_config = 'c:\\fake_src\\tools-webrtc\\mb\\mb_config.pyl'
self.default_isolate_map = ('c:\\fake_src\\testing\\buildbot\\'
'gn_isolate_map.pyl')
self.platform = 'win32'
@ -34,7 +34,7 @@ class FakeMBW(mb.MetaBuildWrapper):
self.sep = '\\'
else:
self.chromium_src_dir = '/fake_src'
self.default_config = '/fake_src/tools/mb/mb_config.pyl'
self.default_config = '/fake_src/tools-webrtc/mb/mb_config.pyl'
self.default_isolate_map = '/fake_src/testing/buildbot/gn_isolate_map.pyl'
self.executable = '/usr/bin/python'
self.platform = 'linux2'
@ -176,35 +176,6 @@ TEST_CONFIG = """\
}
"""
TEST_BAD_CONFIG = """\
{
'configs': {
'gn_rel_bot_1': ['gn', 'rel', 'chrome_with_codecs'],
'gn_rel_bot_2': ['gn', 'rel', 'bad_nested_config'],
},
'masters': {
'chromium': {
'a': 'gn_rel_bot_1',
'b': 'gn_rel_bot_2',
},
},
'mixins': {
'gn': {'type': 'gn'},
'chrome_with_codecs': {
'gn_args': 'proprietary_codecs=true',
},
'bad_nested_config': {
'mixins': ['chrome_with_codecs'],
},
'rel': {
'gn_args': 'is_debug=false',
},
},
}
"""
GYP_HACKS_CONFIG = """\
{
'masters': {
@ -798,34 +769,6 @@ class UnitTest(unittest.TestCase):
mbw = self.fake_mbw()
self.check(['validate'], mbw=mbw, ret=0)
def test_bad_validate(self):
mbw = self.fake_mbw()
mbw.files[mbw.default_config] = TEST_BAD_CONFIG
self.check(['validate'], mbw=mbw, ret=1)
def test_gyp_env_hacks(self):
mbw = self.fake_mbw()
mbw.files[mbw.default_config] = GYP_HACKS_CONFIG
self.check(['lookup', '-c', 'fake_config'], mbw=mbw,
ret=0,
out=("GYP_DEFINES='foo=bar baz=1'\n"
"GYP_LINK_CONCURRENCY=1\n"
"LLVM_FORCE_HEAD_REVISION=1\n"
"python build/gyp_chromium -G output_dir=_path_\n"))
if __name__ == '__main__':
unittest.main()
def test_validate(self):
mbw = self.fake_mbw()
self.check(['validate'], mbw=mbw, ret=0)
def test_bad_validate(self):
mbw = self.fake_mbw()
mbw.files[mbw.default_config] = TEST_BAD_CONFIG
self.check(['validate'], mbw=mbw, ret=1)
def test_gyp_env_hacks(self):
mbw = self.fake_mbw()
mbw.files[mbw.default_config] = GYP_HACKS_CONFIG

View file

@ -1,34 +0,0 @@
# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
def _CommonChecks(input_api, output_api):
results = []
# Validate the format of the mb_config.pyl file.
mb_script = input_api.os_path.join(input_api.PresubmitLocalPath(), '..',
'..', 'tools', 'mb', 'mb.py')
mb_config_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
'mb_config.pyl')
cmd = [input_api.python_executable, mb_script, 'validate', '--config-file',
mb_config_path]
kwargs = {'cwd': input_api.PresubmitLocalPath()}
results.extend(input_api.RunTests([
input_api.Command(name='mb_validate',
cmd=cmd, kwargs=kwargs,
message=output_api.PresubmitError)]))
return results
def CheckChangeOnUpload(input_api, output_api):
return _CommonChecks(input_api, output_api)
def CheckChangeOnCommit(input_api, output_api):
return _CommonChecks(input_api, output_api)