Skip to content

Commit 7998fbf

Browse files
authored
Merge pull request #1941 from apache/abderrahim/junction-remotes
_context: use artifact caches from the parent project for junctions
2 parents ad6b437 + f1f79c8 commit 7998fbf

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎src/buildstream/_context.py‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,13 @@ def _resolve_specs_for_project(
807807

808808
# If there are any project recommendations, append them at the end
809809
project_remotes = getattr(project, project_attribute)
810+
811+
junction = project.junction
812+
while junction:
813+
parent_project = junction._get_project()
814+
project_remotes = getattr(parent_project, project_attribute) + project_remotes
815+
junction = parent_project.junction
816+
810817
remotes = list(utils._deduplicate(remotes + project_remotes))
811818

812819
return remotes

‎tests/artifactcache/junctions.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_push_pull(cli, tmpdir, datafiles):
6868
# In the parent project's cache
6969
assert_shared(cli, share, project, "target.bst", project_name="parent")
7070
assert_shared(cli, share, project, "app.bst", project_name="parent")
71-
assert_not_shared(cli, share, base_project, "base-element.bst", project_name="base")
71+
assert_shared(cli, share, base_project, "base-element.bst", project_name="base")
7272

7373
# In the junction project's cache
7474
assert_not_shared(cli, base_share, project, "target.bst", project_name="parent")

0 commit comments

Comments
 (0)