diff options
author | Raoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk> | 2019-02-28 15:13:38 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-03-14 07:12:34 +0000 |
commit | 6a1e74619e0009ca5611bba025b8dcf08bec353e (patch) | |
tree | c75f062f36ebf71556cc5ed3dbe78d1f0b4693ec /buildstream/_scheduler/queues/fetchqueue.py | |
parent | 5de8de8ec76609c3eb3a75443d2566b55c29b440 (diff) | |
download | buildstream-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/_scheduler/queues/fetchqueue.py')
-rw-r--r-- | buildstream/_scheduler/queues/fetchqueue.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/buildstream/_scheduler/queues/fetchqueue.py b/buildstream/_scheduler/queues/fetchqueue.py index fc11fd1d1..db5e470f9 100644 --- a/buildstream/_scheduler/queues/fetchqueue.py +++ b/buildstream/_scheduler/queues/fetchqueue.py @@ -35,13 +35,14 @@ class FetchQueue(Queue): complete_name = "Fetched" resources = [ResourceType.DOWNLOAD] - def __init__(self, scheduler, skip_cached=False): + def __init__(self, scheduler, skip_cached=False, fetch_original=False): super().__init__(scheduler) self._skip_cached = skip_cached + self._fetch_original = fetch_original def process(self, element): - element._fetch() + element._fetch(fetch_original=self._fetch_original) def status(self, element): # state of dependencies may have changed, recalculate element state @@ -62,7 +63,8 @@ class FetchQueue(Queue): # This will automatically skip elements which # have no sources. - if element._get_consistency() == Consistency.CACHED: + + if not element._should_fetch(self._fetch_original): return QueueStatus.SKIP return QueueStatus.READY |