Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_context: use artifact caches from the parent project for junctions #1941

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/buildstream/_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/artifactcache/junctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Loading