summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-04-15 17:47:12 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-04-15 20:13:13 +0900
commit138083752bc74f64c7bcce2f633f2114a3a6efa5 (patch)
tree30651d2debf323416f808502774384d027119fa8
parentb9eec0cadcc05d1d791beb4a1411400c19bedb0b (diff)
downloadbuildstream-138083752bc74f64c7bcce2f633f2114a3a6efa5.tar.gz
_stream.py: Mark all elements as pulled in Stream.push()
Marking all elements as pulled in Stream.push() ensures that cache keys are resolved before pushing elements, otherwise state is left unresolved in non-strict mode while elements are awaiting to download an artifact by it's strict cache key. Fixes #990
-rw-r--r--buildstream/_stream.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index 64a578c92..fa57f4468 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -441,6 +441,20 @@ class Stream():
self._message(MessageType.INFO, "Attempting to fetch missing artifact buildtrees")
self._add_queue(PullQueue(self._scheduler))
self._enqueue_plan(require_buildtrees)
+ else:
+ # FIXME: This hack should be removed as a result of refactoring
+ # Element._update_state()
+ #
+ # This workaround marks all dependencies of all selected elements as
+ # "pulled" before trying to push.
+ #
+ # Instead of lying to the elements and telling them they have already
+ # been pulled, we should have something more consistent with how other
+ # state bits are handled; and explicitly tell the elements that they
+ # need to be pulled with something like Element._schedule_pull().
+ #
+ for element in elements:
+ element._pull_done()
push_queue = ArtifactPushQueue(self._scheduler)
self._add_queue(push_queue)