Bug 1257448 - Don't emit an error on unknown implied options when their resolved value is None. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 15 Apr 2016 06:43:35 +0900
changeset 331180 334804a9afacc402b16c172a97bb85919510a8e8
parent 331179 225e6dc0f971cf6df960e7a5ec4579536fc1cb77
child 331181 b848122c64f90b399ab0d871341ce412cc9db993
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1257448
milestone48.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 1257448 - Don't emit an error on unknown implied options when their resolved value is None. r=nalexander imply_option has no effect when the resolved value is None, so the same logic can be applied when checking for unknown implied options. This allows to imply options that may not always exist (because they are in a configure file that is optionally included). Ideally, it would be better not to do this, but until we have something better than optionally included configure files for --disable-compile-environment, this is a necessary evil.
python/mozbuild/mozbuild/configure/__init__.py
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -216,20 +216,23 @@ class ConfigureSandbox(dict):
                     'Option `%s` is not handled ; reference it with a @depends'
                     % option.option
                 )
 
             self._value_for(option)
 
         # All implied options should exist.
         for implied_option in self._implied_options:
-            raise ConfigureError(
-                '`%s`, emitted from `%s` line %d, is unknown.'
-                % (implied_option.option, implied_option.caller[1],
-                   implied_option.caller[2]))
+            value = self._resolve(implied_option.value,
+                                  need_help_dependency=False)
+            if value is not None:
+                raise ConfigureError(
+                    '`%s`, emitted from `%s` line %d, is unknown.'
+                    % (implied_option.option, implied_option.caller[1],
+                       implied_option.caller[2]))
 
         # All options should have been removed (handled) by now.
         for arg in self._helper:
             without_value = arg.split('=', 1)[0]
             raise InvalidOptionError('Unknown option: %s' % without_value)
 
         # Run the execution queue
         for func, args in self._execution_queue: