You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by tv...@apache.org on 2021/10/28 06:53:25 UTC

[buildstream] 01/01: _stream.py: Fix double pull scheduling on the same element in `bst shell`

This is an automated email from the ASF dual-hosted git repository.

tvb pushed a commit to branch tristan/fix-double-pull
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 9f2144f397dddec7eec212de2fd7d0abf2b046ac
Author: Tristan van Berkom <tr...@codethink.co.uk>
AuthorDate: Thu Oct 28 15:51:45 2021 +0900

    _stream.py: Fix double pull scheduling on the same element in `bst shell`
    
    When running `bst shell --build` we need to add the toplevel element to
    the dependency list for the `pull` invocation, but this is not needed
    when running without the `--build` option.
---
 src/buildstream/_stream.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index ca4a098..f8455c5 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -295,10 +295,14 @@ class Stream:
             element = self.targets[0]
             element._set_required(scope)
 
+            if scope == _Scope.BUILD:
+                pull_elements = [element] + elements
+            else:
+                pull_elements = elements
+
             # Check whether the required elements are cached, and then
             # try to pull them if they are not already cached.
             #
-            pull_elements = [element] + elements
             self.query_cache(pull_elements)
             self._pull_missing_artifacts(pull_elements)