Skip to content

Commit

Permalink
_project.py: use artifact caches from the parent project for junctions
Browse files Browse the repository at this point in the history
This makes a junction use the artifact cache of the parent project
before the ones defined for the junction

Fixes apache#401
  • Loading branch information
abderrahim authored and jjardon committed Feb 8, 2019
1 parent 1ee4a4b commit 24c0de1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 1 addition & 4 deletions buildstream/_artifactcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,8 +1046,5 @@ def _get_cache_volume_size(self):
# A list of ArtifactCacheSpec instances describing the remote artifact caches.
#
def _configured_remote_artifact_cache_specs(context, project):
project_overrides = context.get_overrides(project.name)
project_extra_specs = ArtifactCache.specs_from_config_node(project_overrides)

return list(utils._deduplicate(
project_extra_specs + project.artifact_cache_specs + context.artifact_cache_specs))
project.artifact_cache_specs + context.artifact_cache_specs))
10 changes: 9 additions & 1 deletion buildstream/_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,15 @@ def _load_second_pass(self):
#

# Load artifacts pull/push configuration for this project
self.artifact_cache_specs = ArtifactCache.specs_from_config_node(config, self.directory)
project_specs = ArtifactCache.specs_from_config_node(config, self.directory)
override_specs = ArtifactCache.specs_from_config_node(
self._context.get_overrides(self.name), self.directory)

self.artifact_cache_specs = override_specs + project_specs

if self.junction:
parent = self.junction._get_project()
self.artifact_cache_specs = parent.artifact_cache_specs + self.artifact_cache_specs

# Load remote-execution configuration for this project
project_specs = SandboxRemote.specs_from_config_node(config, self.directory)
Expand Down

0 comments on commit 24c0de1

Please sign in to comment.