summaryrefslogtreecommitdiff
path: root/buildstream/_loader.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildstream/_loader.py')
-rw-r--r--buildstream/_loader.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/buildstream/_loader.py b/buildstream/_loader.py
index 2cd143f49..2ced3abfa 100644
--- a/buildstream/_loader.py
+++ b/buildstream/_loader.py
@@ -362,7 +362,18 @@ class Loader():
source._stage(basedir)
- project = Project(basedir, self.context, junction=element)
+ project_dir = os.path.join(basedir, element.path)
+
+ try:
+ project = Project(project_dir, self.context, junction=element)
+ except LoadError as e:
+ if e.reason == LoadErrorReason.MISSING_FILE:
+ raise LoadError(reason=e.reason,
+ message="Could not find the project.conf file for {}. "
+ "Expecting a project at path '{}' within {}".
+ format(element, element.path or '.', source)) from e
+ else:
+ raise
loader = Loader(project, [], parent=self, tempdir=basedir)