зеркало из https://github.com/mozilla/gecko-dev.git
merge mozilla-central to mozilla-inbound. r=merge a=merge
This commit is contained in:
Коммит
94ad8fa71a
|
@ -353,28 +353,6 @@ def hg_version(hg):
|
|||
|
||||
return Version(match.group(1))
|
||||
|
||||
# Resolve Mercurial config items so other checks have easy access.
|
||||
# Do NOT set this in the config because it may contain sensitive data
|
||||
# like API keys.
|
||||
@depends_all(check_build_environment, hg, hg_version)
|
||||
@imports('os')
|
||||
def hg_config(build_env, hg, version):
|
||||
env = dict(os.environ)
|
||||
env['HGPLAIN'] = '1'
|
||||
|
||||
# Warnings may get sent to stderr. But check_cmd_output() ignores
|
||||
# stderr if exit code is 0. And the command should always succeed if
|
||||
# `hg version` worked.
|
||||
out = check_cmd_output(hg, 'config', env=env, cwd=build_env.topsrcdir)
|
||||
|
||||
config = {}
|
||||
|
||||
for line in out.strip().splitlines():
|
||||
key, value = [s.strip() for s in line.split('=', 1)]
|
||||
config[key] = value
|
||||
|
||||
return config
|
||||
|
||||
@depends_if(git)
|
||||
@checking('for Git version')
|
||||
@imports('re')
|
||||
|
|
|
@ -404,11 +404,10 @@ always = dependable(True)
|
|||
never = dependable(False)
|
||||
|
||||
|
||||
# Create a decorator that will only execute the body of a function
|
||||
# if the passed function returns True when passed all positional
|
||||
# arguments.
|
||||
# Like @depends, but the decorated function is only called if one of the
|
||||
# arguments it would be called with has a positive value (bool(value) is True)
|
||||
@template
|
||||
def depends_tmpl(eval_args_fn, *args, **kwargs):
|
||||
def depends_if(*args, **kwargs):
|
||||
if kwargs:
|
||||
assert len(kwargs) == 1
|
||||
when = kwargs['when']
|
||||
|
@ -417,26 +416,11 @@ def depends_tmpl(eval_args_fn, *args, **kwargs):
|
|||
def decorator(func):
|
||||
@depends(*args, when=when)
|
||||
def wrapper(*args):
|
||||
if eval_args_fn(args):
|
||||
if any(arg for arg in args):
|
||||
return func(*args)
|
||||
return wrapper
|
||||
return decorator
|
||||
|
||||
|
||||
# Like @depends, but the decorated function is only called if one of the
|
||||
# arguments it would be called with has a positive value (bool(value) is True)
|
||||
@template
|
||||
def depends_if(*args, **kwargs):
|
||||
return depends_tmpl(any, *args, **kwargs)
|
||||
|
||||
|
||||
# Like @depends, but the decorated function is only called if all of the
|
||||
# arguments it would be called with have a positive value.
|
||||
@template
|
||||
def depends_all(*args, **kwargs):
|
||||
return depends_tmpl(all, *args, **kwargs)
|
||||
|
||||
|
||||
# Hacks related to old-configure
|
||||
# ==============================
|
||||
|
||||
|
|
|
@ -365,42 +365,6 @@ def tup_progs(build_backends):
|
|||
|
||||
tup = check_prog('TUP', tup_progs)
|
||||
|
||||
# watchman detection
|
||||
# ==============================================================
|
||||
|
||||
watchman = check_prog('WATCHMAN', ('watchman',), allow_missing=True)
|
||||
|
||||
@depends_if(watchman)
|
||||
@checking('for watchman version')
|
||||
@imports('json')
|
||||
def watchman_version(watchman):
|
||||
out = check_cmd_output(watchman, 'version')
|
||||
res = json.loads(out)
|
||||
return Version(res['version'])
|
||||
|
||||
@depends_all(hg_version, hg_config, watchman)
|
||||
@checking('for watchman Mercurial integration')
|
||||
@imports('os')
|
||||
def watchman_hg(hg_version, hg_config, watchman):
|
||||
if hg_version < Version('3.8'):
|
||||
return 'no (Mercurial 3.8+ required)'
|
||||
|
||||
ext_enabled = False
|
||||
mode_disabled = False
|
||||
|
||||
for k in ('extensions.fsmonitor', 'extensions.hgext.fsmonitor'):
|
||||
if k in hg_config and hg_config[k] != '!':
|
||||
ext_enabled = True
|
||||
|
||||
mode_disabled = hg_config.get('fsmonitor.mode') == 'off'
|
||||
|
||||
if not ext_enabled:
|
||||
return 'no (fsmonitor extension not enabled)'
|
||||
if mode_disabled:
|
||||
return 'no (fsmonitor.mode=off disables fsmonitor)'
|
||||
|
||||
return True
|
||||
|
||||
# Miscellaneous programs
|
||||
# ==============================================================
|
||||
check_prog('DOXYGEN', ('doxygen',), allow_missing=True)
|
||||
|
|
Загрузка…
Ссылка в новой задаче