You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ju...@apache.org on 2021/03/17 16:51:10 UTC

[buildstream] branch juerg/non-strict-cache-key created (now 51b6fe1)

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

juergbi pushed a change to branch juerg/non-strict-cache-key
in repository https://gitbox.apache.org/repos/asf/buildstream.git.


      at 51b6fe1  element.py: Compute cache key also for rdep without buildable callback

This branch includes the following new commits:

     new 772e786  element.py: Reorder checks in _buildable()
     new 51b6fe1  element.py: Compute cache key also for rdep without buildable callback

The 2 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/02: element.py: Reorder checks in _buildable()

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

juergbi pushed a commit to branch juerg/non-strict-cache-key
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 772e7868147a4e6ecd8a9f1923310fe854715466
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Wed Mar 17 16:11:11 2021 +0100

    element.py: Reorder checks in _buildable()
    
    Source cache status is not always available for non-build pipelines.
    Don't call `_fetch_needed()` if `__assemble_scheduled` is `False`.
---
 src/buildstream/element.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index 6a296bf..eb1b02c 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -1264,10 +1264,12 @@ class Element(Plugin):
     #    (bool): Whether this element can currently be built
     #
     def _buildable(self):
-        if self._fetch_needed():
+        # This check must be before `_fetch_needed()` as source cache status
+        # is not always available for non-build pipelines.
+        if not self.__assemble_scheduled:
             return False
 
-        if not self.__assemble_scheduled:
+        if self._fetch_needed():
             return False
 
         return self.__build_deps_uncached == 0


[buildstream] 02/02: element.py: Compute cache key also for rdep without buildable callback

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

juergbi pushed a commit to branch juerg/non-strict-cache-key
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 51b6fe1919c4220cfbf386efd2b1148e26092e1f
Author: Jürg Billeter <j...@bitron.ch>
AuthorDate: Wed Mar 17 14:54:57 2021 +0100

    element.py: Compute cache key also for rdep without buildable callback
    
    The reverse dependency may not be in the build queue yet and thus, the
    buildable callback may be `None`. However, it's still necessary to
    update the cache key in non-strict mode.
    
    Fixes #1452.
    
    Fixes: 8d9bf024 ("element.py: Stop computing cache keys when...")
---
 src/buildstream/element.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index eb1b02c..b9b06ba 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -2412,10 +2412,12 @@ class Element(Plugin):
                     rdep.__build_deps_uncached -= 1
                     assert not rdep.__build_deps_uncached < 0
 
-                    if rdep.__buildable_callback is not None and rdep._buildable():
+                    if rdep._buildable():
                         rdep.__update_cache_key_non_strict()
-                        rdep.__buildable_callback(rdep)
-                        rdep.__buildable_callback = None
+
+                        if rdep.__buildable_callback is not None:
+                            rdep.__buildable_callback(rdep)
+                            rdep.__buildable_callback = None
 
     # _walk_artifact_files()
     #