diff options
author | James Ennis <james.ennis@codethink.co.uk> | 2019-06-25 12:24:26 +0100 |
---|---|---|
committer | James Ennis <james.ennis@codethink.co.uk> | 2019-07-31 12:01:42 +0100 |
commit | bc9154c3a7115ed50ea3f9d4c5d2285b262f55e1 (patch) | |
tree | 54b24abeb536c8a7265c7d0331520bfc2e207512 | |
parent | a3a5459aba0ede821c568d31e09e02eb29f4e2b0 (diff) | |
download | buildstream-jennis/revert_junction_behaviour.tar.gz |
_project.py: Revert back to not caching junctioned elementsjennis/revert_junction_behaviour
Originally, the intended default behaviour of BuildStream was to
only cache project elements in project specific remotes.
This behaviour was broken by: 24c0de16faec2b8b9bd6a03504ce951dc49afbe2.
Introduced in !1113.
This patch reverts the behaviour and asserts that junctioned elements
are not pushed to their parent's project-specific remote.
-rw-r--r-- | src/buildstream/_basecache.py | 6 | ||||
-rw-r--r-- | src/buildstream/_project.py | 10 | ||||
-rw-r--r-- | tests/artifactcache/junctions.py | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/src/buildstream/_basecache.py b/src/buildstream/_basecache.py index 52b777fb2..5d93562fd 100644 --- a/src/buildstream/_basecache.py +++ b/src/buildstream/_basecache.py @@ -102,10 +102,14 @@ class BaseCache(): # @classmethod def _configured_remote_cache_specs(cls, context, project): + project_overrides = context.get_overrides(project.name) + project_extra_specs = cls.specs_from_config_node(project_overrides) + project_specs = getattr(project, cls.spec_name) context_specs = getattr(context, cls.spec_name) - return list(utils._deduplicate(project_specs + context_specs)) + return list(utils._deduplicate( + project_extra_specs + project_specs + context_specs)) # setup_remotes(): # diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py index 9428ab4f6..8d06c7cef 100644 --- a/src/buildstream/_project.py +++ b/src/buildstream/_project.py @@ -643,15 +643,7 @@ class Project(): # # Load artifacts pull/push configuration for this project - 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 + self.artifact_cache_specs = ArtifactCache.specs_from_config_node(config, self.directory) # Load source caches with pull/push config self.source_cache_specs = SourceCache.specs_from_config_node(config, self.directory) diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py index 34d6916e8..c93d79c4b 100644 --- a/tests/artifactcache/junctions.py +++ b/tests/artifactcache/junctions.py @@ -57,7 +57,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_shared(cli, share, base_project, 'base-element.bst', project_name='base') + assert_not_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') |