summaryrefslogtreecommitdiff
path: root/src/buildstream/element.py
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-08-15 15:27:17 +0100
committerJames Ennis <james.ennis@codethink.co.uk>2019-08-19 12:14:04 +0100
commit5af343359b90dd5a77fbd0fda00e0e1f34ad6ff7 (patch)
tree39f896df7a89929a39ea86e290743c4485e8dd5b /src/buildstream/element.py
parentd590907a0952a61179dd3e3a8f9d3ad31fe774f9 (diff)
downloadbuildstream-5af343359b90dd5a77fbd0fda00e0e1f34ad6ff7.tar.gz
element.py: Cache the project name
Diffstat (limited to 'src/buildstream/element.py')
-rw-r--r--src/buildstream/element.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index 64686bf51..f5b73c6f6 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -197,6 +197,7 @@ class Element(Plugin):
if not meta.is_junction:
project.ensure_fully_loaded()
+ self.project_name = self._get_project().name
self.normal_name = _get_normal_name(self.name)
"""A normalized element name
@@ -586,13 +587,12 @@ class Element(Plugin):
Returns:
(str): The relative path for the artifact
"""
- project = self._get_project()
if key is None:
key = self._get_cache_key()
assert key is not None
- return _compose_artifact_name(project.name, self.normal_name, key)
+ return _compose_artifact_name(self.project_name, self.normal_name, key)
def stage_artifact(self, sandbox, *, path=None, include=None, exclude=None, orphans=True, update_mtimes=None):
"""Stage this element's output artifact in the sandbox