Bug 1411462 - Normalize when argument earlier in imply_option(); r?glandium
This makes `configure --help` work again (it stopped working due to
370a4a2a7898 (
bug 1405982).
MozReview-Commit-ID: 2gCmAAsE0qW
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -904,16 +904,19 @@ class ConfigureSandbox(dict):
The `value` argument can also be (and usually is) a reference to a
@depends function, in which case the result of that function will be
used as per the descripted mapping above.
The `reason` argument indicates what caused the option to be implied.
It is necessary when it cannot be inferred from the `value`.
'''
+
+ when = self._normalize_when(when, 'imply_option')
+
# Don't do anything when --help was on the command line
if self._help:
return
if not reason and isinstance(value, SandboxDependsFunction):
deps = self._depends[value].dependencies
possible_reasons = [d for d in deps if d != self._help_option]
if len(possible_reasons) == 1:
if isinstance(possible_reasons[0], Option):
@@ -926,18 +929,16 @@ class ConfigureSandbox(dict):
reason = "imply_option at %s:%s" % (filename, line)
if not reason:
raise ConfigureError(
"Cannot infer what implies '%s'. Please add a `reason` to "
"the `imply_option` call."
% option)
- when = self._normalize_when(when, 'imply_option')
-
prefix, name, values = Option.split_option(option)
if values != ():
raise ConfigureError("Implied option must not contain an '='")
self._implied_options.append(ReadOnlyNamespace(
option=option,
prefix=prefix,
name=name,