Bug 1397406 - Don't mark finder as a protected attribute; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Wed, 06 Sep 2017 12:13:38 -0700
changeset 660258 94c02703f07c931bfb9796611403859b07c3a2c0
parent 659873 c959327c6b75cd4930a6ea087583c38b805e7524
child 660259 8ca48411de46e2d1d67f93c7a2a0703542e3a4e5
push id78338
push usergszorc@mozilla.com
push dateWed, 06 Sep 2017 19:21:56 +0000
reviewersdustin
bugs1397406
milestone57.0a1
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,