Skip to content

Commit cbe213c

Browse files
committed
_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 24c0de1, but regressed at some point Fixes #1839
1 parent 6b2ebbd commit cbe213c

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
@@ -767,6 +767,13 @@ def _resolve_specs_for_project(
767767

768768
# If there are any project recommendations, append them at the end
769769
project_remotes = getattr(project, project_attribute)
770+
771+
junction = project.junction
772+
while junction:
773+
parent_project = junction._get_project()
774+
project_remotes = getattr(parent_project, project_attribute) + project_remotes
775+
junction = parent_project.junction
776+
770777
remotes = list(utils._deduplicate(remotes + project_remotes))
771778

772779
return remotes

tests/artifactcache/junctions.py

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

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

0 commit comments

Comments
 (0)