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

akitouni pushed a commit to branch abderrahim/junction-remotes
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit fca3645b50488874736521e3aa6093dbc594c100
Author: Abderrahim Kitouni <[email protected]>
AuthorDate: Fri Aug 2 11:51:49 2024 +0100

    _context: use artifact caches from the parent project for junctions
    
    This makes a junction use the artifact cache of the parent project
    before the ones defined for the junction
    
    This was originally done in 24c0de16faec2b8b9bd6a03504ce951dc49afbe2,
    but regressed at some point
    
    Fixes https://github.com/apache/buildstream/issues/1839
---
 src/buildstream/_context.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/buildstream/_context.py b/src/buildstream/_context.py
index 31b2df85f..55f1fe808 100644
--- a/src/buildstream/_context.py
+++ b/src/buildstream/_context.py
@@ -767,6 +767,13 @@ class Context:
 
         # If there are any project recommendations, append them at the end
         project_remotes = getattr(project, project_attribute)
+
+        junction = project.junction
+        while junction:
+            parent_project = junction._get_project()
+            project_remotes = getattr(parent_project, project_attribute) + 
project_remotes
+            junction = parent_project.junction
+
         remotes = list(utils._deduplicate(remotes + project_remotes))
 
         return remotes

Reply via email to