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 @@ def _resolve_specs_for_project( # 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 diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py index 83c9e0136..8dfb9c80d 100644 --- a/tests/artifactcache/junctions.py +++ b/tests/artifactcache/junctions.py @@ -69,7 +69,7 @@ def test_push_pull(cli, tmpdir, datafiles): # In the parent project's cache assert_shared(cli, share, project, "target.bst", project_name="parent") assert_shared(cli, share, project, "app.bst", project_name="parent") - assert_not_shared(cli, share, base_project, "base-element.bst", project_name="base") + assert_shared(cli, share, base_project, "base-element.bst", project_name="base") # In the junction project's cache assert_not_shared(cli, base_share, project, "target.bst", project_name="parent")