summaryrefslogtreecommitdiff
path: root/buildstream/_pipeline.py
diff options
context:
space:
mode:
authorRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2019-02-28 15:13:38 +0000
committerJürg Billeter <j@bitron.ch>2019-03-14 07:12:34 +0000
commit6a1e74619e0009ca5611bba025b8dcf08bec353e (patch)
treec75f062f36ebf71556cc5ed3dbe78d1f0b4693ec /buildstream/_pipeline.py
parent5de8de8ec76609c3eb3a75443d2566b55c29b440 (diff)
downloadbuildstream-6a1e74619e0009ca5611bba025b8dcf08bec353e.tar.gz
Integrate source cache with rest of buildstream
This involve introducing new Consistency states `STAGED` and `BOTH` that represent when the source is just in the local CAS and in both the local CAS and unstaged in the source directory. Sources are staged for each element into the local CAS during the fetch stage. If the sources are in the local consistency state `STAGED` when wanting to open a workspace, the original sources are fetched. Relavant tests this affects have been changed. Part of #440
Diffstat (limited to 'buildstream/_pipeline.py')
-rw-r--r--buildstream/_pipeline.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py
index 7cf36f5a7..004776293 100644
--- a/buildstream/_pipeline.py
+++ b/buildstream/_pipeline.py
@@ -395,7 +395,8 @@ class Pipeline():
uncached = []
with self._context.timed_activity("Checking sources"):
for element in elements:
- if element._get_consistency() != Consistency.CACHED:
+ if element._get_consistency() < Consistency.CACHED and \
+ not element._source_cached():
uncached.append(element)
if uncached:
@@ -403,7 +404,7 @@ class Pipeline():
for element in uncached:
detail += " Following sources for element: {} are not cached:\n".format(element._get_full_name())
for source in element.sources():
- if source._get_consistency() != Consistency.CACHED:
+ if source._get_consistency() < Consistency.CACHED:
detail += " {}\n".format(source)
detail += '\n'
detail += "Try fetching these elements first with `bst source fetch`,\n" + \