Roll recipe dependencies (trivial).
This is an automated CL created by the recipe roller. This CL rolls recipe changes from upstream projects (e.g. depot_tools) into downstream projects (e.g. tools/build). More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug. recipe_engine: https://crrev.com/c923df1b4ecf75345768d71a09e0ce17fd21c9aa Autoformat recipes.py with yapf chromium style (olivernewman@google.com) TBR=borenet@google.com Recipe-Tryjob-Bypass-Reason: Autoroller Bugdroid-Send-Email: False Change-Id: Ie3ac5d67b4b1f060d3721100f742dec8fb87deb0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215449 Reviewed-by: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com> Commit-Queue: Recipe Roller <recipe-mega-autoroller@chops-service-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
db5863c24c
commit
0cfdf7fd4c
@ -13,7 +13,6 @@
|
||||
# pylint: disable=pointless-string-statement
|
||||
''''exec python -u -- "$0" ${1+"$@"} # '''
|
||||
# vi: syntax=python
|
||||
|
||||
"""Bootstrap script to clone and forward to the recipe engine tool.
|
||||
|
||||
*******************
|
||||
@ -41,14 +40,14 @@ from collections import namedtuple
|
||||
# revision (str) - the git revision for the engine to get.
|
||||
# branch (str) - the branch to fetch for the engine as an absolute ref (e.g.
|
||||
# refs/heads/master)
|
||||
EngineDep = namedtuple('EngineDep',
|
||||
'url revision branch')
|
||||
EngineDep = namedtuple('EngineDep', 'url revision branch')
|
||||
|
||||
|
||||
class MalformedRecipesCfg(Exception):
|
||||
|
||||
def __init__(self, msg, path):
|
||||
super(MalformedRecipesCfg, self).__init__('malformed recipes.cfg: %s: %r'
|
||||
% (msg, path))
|
||||
full_message = 'malformed recipes.cfg: %s: %r' % (msg, path)
|
||||
super(MalformedRecipesCfg, self).__init__(full_message)
|
||||
|
||||
|
||||
def parse(repo_root, recipes_cfg_path):
|
||||
@ -86,8 +85,8 @@ def parse(repo_root, recipes_cfg_path):
|
||||
|
||||
if 'url' not in engine:
|
||||
raise MalformedRecipesCfg(
|
||||
'Required field "url" in dependency "recipe_engine" not found',
|
||||
recipes_cfg_path)
|
||||
'Required field "url" in dependency "recipe_engine" not found',
|
||||
recipes_cfg_path)
|
||||
|
||||
engine.setdefault('revision', '')
|
||||
engine.setdefault('branch', 'refs/heads/master')
|
||||
@ -97,8 +96,8 @@ def parse(repo_root, recipes_cfg_path):
|
||||
if not engine['branch'].startswith('refs/'):
|
||||
engine['branch'] = 'refs/heads/' + engine['branch']
|
||||
|
||||
recipes_path = os.path.join(
|
||||
repo_root, recipes_path.replace('/', os.path.sep))
|
||||
recipes_path = os.path.join(repo_root,
|
||||
recipes_path.replace('/', os.path.sep))
|
||||
return EngineDep(**engine), recipes_path
|
||||
except KeyError as ex:
|
||||
raise MalformedRecipesCfg(ex.message, recipes_cfg_path)
|
||||
@ -114,6 +113,7 @@ REQUIRED_BINARIES = {GIT, VPYTHON, CIPD}
|
||||
def _is_executable(path):
|
||||
return os.path.isfile(path) and os.access(path, os.X_OK)
|
||||
|
||||
|
||||
# TODO: Use shutil.which once we switch to Python3.
|
||||
def _is_on_path(basename):
|
||||
for path in os.environ['PATH'].split(os.pathsep):
|
||||
@ -129,13 +129,13 @@ def _subprocess_call(argv, **kwargs):
|
||||
|
||||
|
||||
def _git_check_call(argv, **kwargs):
|
||||
argv = [GIT]+argv
|
||||
argv = [GIT] + argv
|
||||
logging.info('Running %r', argv)
|
||||
subprocess.check_call(argv, **kwargs)
|
||||
|
||||
|
||||
def _git_output(argv, **kwargs):
|
||||
argv = [GIT]+argv
|
||||
argv = [GIT] + argv
|
||||
logging.info('Running %r', argv)
|
||||
return subprocess.check_output(argv, **kwargs)
|
||||
|
||||
@ -181,10 +181,15 @@ def checkout_engine(engine_path, repo_root, recipes_cfg_path):
|
||||
_git_check_call(['init', engine_path], stdout=NUL)
|
||||
|
||||
try:
|
||||
_git_check_call(['rev-parse', '--verify', '%s^{commit}' % revision],
|
||||
cwd=engine_path, stdout=NUL, stderr=NUL)
|
||||
_git_check_call(['rev-parse', '--verify',
|
||||
'%s^{commit}' % revision],
|
||||
cwd=engine_path,
|
||||
stdout=NUL,
|
||||
stderr=NUL)
|
||||
except subprocess.CalledProcessError:
|
||||
_git_check_call(['fetch', url, branch], cwd=engine_path, stdout=NUL,
|
||||
_git_check_call(['fetch', url, branch],
|
||||
cwd=engine_path,
|
||||
stdout=NUL,
|
||||
stderr=NUL)
|
||||
|
||||
try:
|
||||
@ -213,13 +218,12 @@ def main():
|
||||
if recipes_cfg_path:
|
||||
# calculate repo_root from recipes_cfg_path
|
||||
repo_root = os.path.dirname(
|
||||
os.path.dirname(
|
||||
os.path.dirname(recipes_cfg_path)))
|
||||
os.path.dirname(os.path.dirname(recipes_cfg_path)))
|
||||
else:
|
||||
# find repo_root with git and calculate recipes_cfg_path
|
||||
repo_root = (_git_output(
|
||||
['rev-parse', '--show-toplevel'],
|
||||
cwd=os.path.abspath(os.path.dirname(__file__))).strip())
|
||||
repo_root = (
|
||||
_git_output(['rev-parse', '--show-toplevel'],
|
||||
cwd=os.path.abspath(os.path.dirname(__file__))).strip())
|
||||
repo_root = os.path.abspath(repo_root)
|
||||
recipes_cfg_path = os.path.join(repo_root, 'infra', 'config', 'recipes.cfg')
|
||||
args = ['--package', recipes_cfg_path] + args
|
||||
@ -227,9 +231,9 @@ def main():
|
||||
engine_path = checkout_engine(engine_override, repo_root, recipes_cfg_path)
|
||||
|
||||
try:
|
||||
return _subprocess_call([
|
||||
VPYTHON, '-u',
|
||||
os.path.join(engine_path, 'recipe_engine', 'main.py')] + args)
|
||||
return _subprocess_call(
|
||||
[VPYTHON, '-u',
|
||||
os.path.join(engine_path, 'recipe_engine', 'main.py')] + args)
|
||||
except KeyboardInterrupt:
|
||||
return 1
|
||||
|
||||
|
@ -14,12 +14,12 @@
|
||||
"deps": {
|
||||
"depot_tools": {
|
||||
"branch": "master",
|
||||
"revision": "7a6143385da466fa4ac8f60a196d21acbacde251",
|
||||
"revision": "515b1546c27fd5f03095d91151f8f928018d4398",
|
||||
"url": "https://chromium.googlesource.com/chromium/tools/depot_tools.git"
|
||||
},
|
||||
"recipe_engine": {
|
||||
"branch": "master",
|
||||
"revision": "bae937d72f6b21b53a3218efdb0471861a332c0c",
|
||||
"revision": "c923df1b4ecf75345768d71a09e0ce17fd21c9aa",
|
||||
"url": "https://chromium.googlesource.com/infra/luci/recipes-py.git"
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user