Bug 1411462 - Normalize when argument earlier in imply_option(); r=glandium
authorGregory Szorc <gps@mozilla.com>
Tue, 24 Oct 2017 12:56:10 -0700
changeset 444496 5e6769924323b3c375ca2ee45b7315e8dbaa6122
parent 444495 e7f0ad15263103e680bfd1d17e37497cc349106a
child 444497 6fff2c7ad3fc36bbbced77302f671ac6ddfe97b5
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1411462, 1405982
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
python/mozbuild/mozbuild/configure/__init__.py
--- 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,