diff options
author | Valentin David <valentin.david@codethink.co.uk> | 2018-07-02 11:52:39 +0200 |
---|---|---|
committer | Valentin David <valentin.david@codethink.co.uk> | 2018-07-02 16:25:58 +0200 |
commit | 356a6347db62a2c560b4aa19b6d8ff8317542aca (patch) | |
tree | bf3b9b6817e8c5baba0c39dfb5038369100f1d22 | |
parent | 1970bb16e5250d2197de9f7d2dfeee3cd54e7910 (diff) | |
download | buildstream-356a6347db62a2c560b4aa19b6d8ff8317542aca.tar.gz |
Fix 'first pass config' behavior for loading elements
-rw-r--r-- | buildstream/_loader/loader.py | 6 | ||||
-rw-r--r-- | buildstream/_loader/metaelement.py | 4 | ||||
-rw-r--r-- | buildstream/element.py | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/buildstream/_loader/loader.py b/buildstream/_loader/loader.py index 3637f39a6..bc431802a 100644 --- a/buildstream/_loader/loader.py +++ b/buildstream/_loader/loader.py @@ -448,7 +448,8 @@ class Loader(): _yaml.node_get(node, Mapping, Symbol.ENVIRONMENT, default_value={}), _yaml.node_get(node, list, Symbol.ENV_NOCACHE, default_value=[]), _yaml.node_get(node, Mapping, Symbol.PUBLIC, default_value={}), - _yaml.node_get(node, Mapping, Symbol.SANDBOX, default_value={})) + _yaml.node_get(node, Mapping, Symbol.SANDBOX, default_value={}), + element_kind == 'junction') # Cache it now, make sure it's already there before recursing self._meta_elements[element_name] = meta_element @@ -521,8 +522,7 @@ class Loader(): "{}: Expected junction but element kind is {}".format(filename, meta_element.kind)) platform = Platform.get_platform() - element = Element._new_from_meta(meta_element, platform.artifactcache, - first_pass=True) + element = Element._new_from_meta(meta_element, platform.artifactcache) element._preflight() for source in element.sources(): diff --git a/buildstream/_loader/metaelement.py b/buildstream/_loader/metaelement.py index 16788e92b..b84654670 100644 --- a/buildstream/_loader/metaelement.py +++ b/buildstream/_loader/metaelement.py @@ -38,7 +38,8 @@ class MetaElement(): # sandbox: Configuration specific to the sandbox environment # def __init__(self, project, name, kind, provenance, sources, config, - variables, environment, env_nocache, public, sandbox): + variables, environment, env_nocache, public, sandbox, + first_pass): self.project = project self.name = name self.kind = kind @@ -52,3 +53,4 @@ class MetaElement(): self.sandbox = sandbox self.build_dependencies = [] self.dependencies = [] + self.first_pass = first_pass diff --git a/buildstream/element.py b/buildstream/element.py index 736589491..aa49484fc 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -891,9 +891,9 @@ class Element(Plugin): # (Element): A newly created Element instance # @classmethod - def _new_from_meta(cls, meta, artifacts, first_pass=False): + def _new_from_meta(cls, meta, artifacts): - if first_pass: + if meta.first_pass: plugins = meta.project.first_pass_config.plugins else: plugins = meta.project.plugins @@ -917,10 +917,10 @@ class Element(Plugin): # Instantiate dependencies for meta_dep in meta.dependencies: - dependency = Element._new_from_meta(meta_dep, artifacts, first_pass=first_pass) + dependency = Element._new_from_meta(meta_dep, artifacts) element.__runtime_dependencies.append(dependency) for meta_dep in meta.build_dependencies: - dependency = Element._new_from_meta(meta_dep, artifacts, first_pass=first_pass) + dependency = Element._new_from_meta(meta_dep, artifacts) element.__build_dependencies.append(dependency) return element |