summaryrefslogtreecommitdiff
path: root/buildstream/element.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/element.py')
-rw-r--r--buildstream/element.py38
1 files changed, 27 insertions, 11 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index f1f0273f6..9d728bfd6 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -963,9 +963,36 @@ class Element(Plugin):
if meta in cls.__instantiated_elements:
return cls.__instantiated_elements[meta]
+ build_deps = [
+ Element._new_from_meta(meta_dep)
+ for meta_dep in meta.build_dependencies
+ ]
+
+ runtime_deps = [
+ Element._new_from_meta(meta_dep)
+ for meta_dep in meta.dependencies
+ ]
+
+ # # Instantiate dependencies
+ # for meta_dep in meta.dependencies:
+ # dependency = Element._new_from_meta(meta_dep)
+ # element.__runtime_dependencies.append(dependency)
+ # dependency.__reverse_dependencies.add(element)
+
+ # for meta_dep in meta.build_dependencies:
+ # dependency = Element._new_from_meta(meta_dep)
+ # element.__build_dependencies.append(dependency)
+ # dependency.__reverse_dependencies.add(element)
+
element = meta.project.create_element(meta, first_pass=meta.first_pass)
cls.__instantiated_elements[meta] = element
+ element.__runtime_dependencies = runtime_deps
+ element.__build_dependencies = build_deps
+
+ for dep in chain(build_deps, runtime_deps):
+ dep.__reverse_dependencies.add(element)
+
# Instantiate sources and generate their keys
for meta_source in meta.sources:
meta_source.first_pass = meta.kind == "junction"
@@ -979,17 +1006,6 @@ class Element(Plugin):
if redundant_ref is not None:
cls.__redundant_source_refs.append((source, redundant_ref))
- # Instantiate dependencies
- for meta_dep in meta.dependencies:
- dependency = Element._new_from_meta(meta_dep)
- element.__runtime_dependencies.append(dependency)
- dependency.__reverse_dependencies.add(element)
-
- for meta_dep in meta.build_dependencies:
- dependency = Element._new_from_meta(meta_dep)
- element.__build_dependencies.append(dependency)
- dependency.__reverse_dependencies.add(element)
-
return element
# _clear_meta_elements_cache()