diff options
author | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-05-30 15:32:06 +0100 |
---|---|---|
committer | Daniel Silverstone <daniel.silverstone@codethink.co.uk> | 2019-05-30 15:37:14 +0100 |
commit | 91a8425224b9b15259b03c94dfba6f40f7609860 (patch) | |
tree | cadc44d4cd29df50bb812f55de41daf8456fa2e8 /src | |
parent | ddd9c32c622786ed434e93e001196707b969bd1e (diff) | |
download | buildstream-91a8425224b9b15259b03c94dfba6f40f7609860.tar.gz |
_loader/loade{r,lement}.py: Do not re-collect already collected elementsdanielsilverstone-ct/iterative-loader-bits
When multiple top level elements are specified we need to keep track
of whether we have completed the iterative collection process.
Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/buildstream/_loader/loadelement.py | 9 | ||||
-rw-r--r-- | src/buildstream/_loader/loader.py | 7 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/buildstream/_loader/loadelement.py b/src/buildstream/_loader/loadelement.py index 684c32554..24b4e7293 100644 --- a/src/buildstream/_loader/loadelement.py +++ b/src/buildstream/_loader/loadelement.py @@ -62,10 +62,11 @@ class LoadElement(): # # Public members # - self.node = node # The YAML node - self.name = filename # The element name - self.full_name = None # The element full name (with associated junction) - self.deps = None # The list of Dependency objects + self.node = node # The YAML node + self.name = filename # The element name + self.full_name = None # The element full name (with associated junction) + self.deps = None # The list of Dependency objects + self.meta_done = False # If the MetaElement for this LoadElement is done self.node_id = next(self._counter) # diff --git a/src/buildstream/_loader/loader.py b/src/buildstream/_loader/loader.py index 161a8cc08..e279501ff 100644 --- a/src/buildstream/_loader/loader.py +++ b/src/buildstream/_loader/loader.py @@ -521,6 +521,11 @@ class Loader(): element = element_queue.pop() meta_element = meta_element_queue.pop() + if element.meta_done: + # This can happen if there are multiple top level targets + # in which case, we simply skip over this element. + continue + for dep in element.dependencies: loader = dep.element._loader @@ -538,6 +543,8 @@ class Loader(): if dep.dep_type != 'build': meta_element.dependencies.append(meta_dep) + element.meta_done = True + return self._meta_elements[top_element.name] # _get_loader(): |