You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:32:09 UTC

[buildstream] branch jennis/subtract_when_required created (now d6f9586)

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

not-in-ldap pushed a change to branch jennis/subtract_when_required
in repository https://gitbox.apache.org/repos/asf/buildstream.git.


      at d6f9586  _stream.py: Don't subtract elements if we have nothing to subtract

This branch includes the following new commits:

     new d6f9586  _stream.py: Don't subtract elements if we have nothing to subtract

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[buildstream] 01/01: _stream.py: Don't subtract elements if we have nothing to subtract

Posted by no...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch jennis/subtract_when_required
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit d6f958676a3579b0d234842c953f6708ca843af5
Author: James Ennis <ja...@codethink.co.uk>
AuthorDate: Mon May 13 12:16:10 2019 +0100

    _stream.py: Don't subtract elements if we have nothing to subtract
---
 buildstream/_stream.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index d4f26e4..4ed0d68 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -242,7 +242,8 @@ class Stream():
                        dynamic_plan=True)
 
         # Remove the tracking elements from the main targets
-        elements = self._pipeline.subtract_elements(elements, track_elements)
+        if track_elements:
+            elements = self._pipeline.subtract_elements(elements, track_elements)
 
         # Assert that the elements we're not going to track are consistent
         self._pipeline.assert_consistent(elements)
@@ -1230,9 +1231,9 @@ class Stream():
 
         if track_elements is None:
             track_elements = []
-
-        # Subtract the track elements from the fetch elements, they will be added separately
-        fetch_plan = self._pipeline.subtract_elements(elements, track_elements)
+        else:
+            # Subtract the track elements from the fetch elements, they will be added separately
+            fetch_plan = self._pipeline.subtract_elements(elements, track_elements)
 
         # Assert consistency for the fetch elements
         self._pipeline.assert_consistent(fetch_plan)
@@ -1241,7 +1242,8 @@ class Stream():
         # let the track plan resolve new refs.
         cached = [elt for elt in fetch_plan
                   if not elt._should_fetch(fetch_original)]
-        fetch_plan = self._pipeline.subtract_elements(fetch_plan, cached)
+        if cached:
+            fetch_plan = self._pipeline.subtract_elements(fetch_plan, cached)
 
         # Construct queues, enqueue and run
         #