Bug 1397406 - Don't mark finder as a protected attribute; r=dustin
authorGregory Szorc <gps@mozilla.com>
Wed, 06 Sep 2017 12:13:38 -0700
changeset 428739 caccc7951f5bd8f0d4b840da0a7b9ea4a5d4df84
parent 428738 4ef48b1ea11bf9ff695a73713d58ed936fa3a140
child 428740 da68a5ff28d0cd132e031b1a67577a19274c01df
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdustin
bugs1397406
milestone57.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 1397406 - Don't mark finder as a protected attribute; r=dustin It seems reasonable to expose this outside of the BuildReader. MozReview-Commit-ID: 4paDbYl9dEd
python/mozbuild/mozbuild/frontend/reader.py
--- a/python/mozbuild/mozbuild/frontend/reader.py
+++ b/python/mozbuild/mozbuild/frontend/reader.py
@@ -845,17 +845,17 @@ class BuildReader(object):
     """
 
     def __init__(self, config, finder=default_finder):
         self.config = config
 
         self._log = logging.getLogger(__name__)
         self._read_files = set()
         self._execution_stack = []
-        self._finder = finder
+        self.finder = finder
 
         # Finder patterns to ignore when searching for moz.build files.
         ignores = {
             # Ignore fake moz.build files used for testing moz.build.
             'python/mozbuild/mozbuild/test',
 
             # Ignore object directories.
             'obj*',
@@ -1109,19 +1109,19 @@ class BuildReader(object):
 
         if mozpath.dirname(relpath) == 'js/src' and \
                 not config.substs.get('JS_STANDALONE'):
             config = ConfigEnvironment.from_config_status(
                 mozpath.join(topobjdir, reldir, 'config.status'))
             config.topobjdir = topobjdir
             config.external_source_dir = None
 
-        context = Context(VARIABLES, config, self._finder)
+        context = Context(VARIABLES, config, self.finder)
         sandbox = MozbuildSandbox(context, metadata=metadata,
-                                  finder=self._finder)
+                                  finder=self.finder)
         sandbox.exec_file(path)
         self._execution_time += time.time() - time_start
         self._file_count += len(context.all_paths)
 
         # Yield main context before doing any processing. This gives immediate
         # consumers an opportunity to change state before our remaining
         # processing is performed.
         yield context
@@ -1142,17 +1142,17 @@ class BuildReader(object):
             # emitted after their parent, so accumulate the gyp contexts.
             # We could emit the parent context before processing gyp
             # configuration, but we need to add the gyp objdirs to that context
             # first.
             from .gyp_reader import GypProcessor
             non_unified_sources = set()
             for s in gyp_dir.non_unified_sources:
                 source = SourcePath(context, s)
-                if not self._finder.get(source.full_path):
+                if not self.finder.get(source.full_path):
                     raise SandboxValidationError('Cannot find %s.' % source,
                         context)
                 non_unified_sources.add(source)
             action_overrides = {}
             for action, script in gyp_dir.action_overrides.iteritems():
                 action_overrides[action] = SourcePath(context, script)
 
             gyp_processor = GypProcessor(context.config,