Bug 1322025 - Don't automatically add --help dependencies to CombinedDependsFunctions. r=chmanchester draft
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 25 Jan 2017 17:10:03 +0900
changeset 467003 88a5a2db38e25e037dbb9e4adce1b7d38d684d66
parent 467002 ea5f4083f66593ff2a8428fde899861434a4ddff
child 467004 8a5f8d07a994e4af834f96bcb8d1da9cbc15ed4c
push id43083
push userbmo:mh+mozilla@glandium.org
push dateFri, 27 Jan 2017 00:32:10 +0000
reviewerschmanchester
bugs1322025
milestone54.0a1
Bug 1322025 - Don't automatically add --help dependencies to CombinedDependsFunctions. r=chmanchester Adding those dependencies, retrospectively, only worked around the poor handling of --help requirements by the linter, that we fixed a few commits ago. This is now not necessary anymore.
python/mozbuild/mozbuild/configure/__init__.py
--- a/python/mozbuild/mozbuild/configure/__init__.py
+++ b/python/mozbuild/mozbuild/configure/__init__.py
@@ -112,35 +112,23 @@ class CombinedDependsFunction(DependsFun
         for d in dependencies:
             if isinstance(d, CombinedDependsFunction) and d._func is func:
                 for d2 in d.dependencies:
                     if d2 not in flatten_deps:
                         flatten_deps.append(d2)
             elif d not in flatten_deps:
                 flatten_deps.append(d)
 
-        # Automatically add a --help dependency if one of the dependencies
-        # depends on it.
-        for d in flatten_deps:
-            if (isinstance(d, DependsFunction) and
-                sandbox._help_option in d.dependencies):
-                flatten_deps.insert(0, sandbox._help_option)
-                break
-
         super(CombinedDependsFunction, self).__init__(
             sandbox, func, flatten_deps)
 
     @memoize
     def result(self, need_help_dependency=False):
-        # Ignore --help for the combined result
-        deps = self.dependencies
-        if deps[0] == self.sandbox._help_option:
-            deps = deps[1:]
         resolved_args = [self.sandbox._value_for(d, need_help_dependency)
-                         for d in deps]
+                         for d in self.dependencies]
         return self._func(resolved_args)
 
     def __eq__(self, other):
         return (isinstance(other, self.__class__) and
                 self._func is other._func and
                 set(self.dependencies) == set(other.dependencies))
 
     def __ne__(self, other):