summaryrefslogtreecommitdiff
path: root/buildstream
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2018-08-22 20:31:43 +0200
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-08-23 06:40:19 +0000
commit2215859c925c48dfebd1315b4f5ad2834689ea22 (patch)
treeb463d3e1874efbeee1a5090db5d611615458342d /buildstream
parentb0d1aa8340e1ffb0cecb119a80e368cfa2e724ef (diff)
downloadbuildstream-2215859c925c48dfebd1315b4f5ad2834689ea22.tar.gz
Improve error message for deleted open workspaces
Fixes #576.
Diffstat (limited to 'buildstream')
-rw-r--r--buildstream/_pipeline.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py
index 4e5f4d0e9..1f75b2e9e 100644
--- a/buildstream/_pipeline.py
+++ b/buildstream/_pipeline.py
@@ -355,10 +355,14 @@ class Pipeline():
#
def assert_consistent(self, elements):
inconsistent = []
+ inconsistent_workspaced = []
with self._context.timed_activity("Checking sources"):
for element in elements:
if element._get_consistency() == Consistency.INCONSISTENT:
- inconsistent.append(element)
+ if element._get_workspace():
+ inconsistent_workspaced.append(element)
+ else:
+ inconsistent.append(element)
if inconsistent:
detail = "Exact versions are missing for the following elements:\n\n"
@@ -372,6 +376,13 @@ class Pipeline():
raise PipelineError("Inconsistent pipeline", detail=detail, reason="inconsistent-pipeline")
+ if inconsistent_workspaced:
+ detail = "Some workspaces do not exist but are not closed\n" + \
+ "Try closing them with `bst workspace close`\n\n"
+ for element in inconsistent_workspaced:
+ detail += " " + element._get_full_name() + "\n"
+ raise PipelineError("Inconsistent pipeline", detail=detail, reason="inconsistent-pipeline-workspaced")
+
#############################################################
# Private Methods #
#############################################################