summaryrefslogtreecommitdiff
path: root/src/buildstream/_project.py
diff options
context:
space:
mode:
authorJames Ennis <james.ennis@codethink.co.uk>2019-08-01 12:06:02 +0100
committerJames Ennis <james.ennis@codethink.com>2019-08-06 13:03:47 +0000
commitef757b5e8ee7d1bfab8750d4a87cbc374eda295e (patch)
tree1ed88743f0d11200c87ffeaed740f294504568be /src/buildstream/_project.py
parent34529551faf0c1206e5fe887355da882a5c32c9e (diff)
downloadbuildstream-ef757b5e8ee7d1bfab8750d4a87cbc374eda295e.tar.gz
plugins/elements/junction.py: Add 'cache-junction-elements' option
The 'cache-junction-elements' configuration option for junction's is a boolean which enables elements from within the junction to interact with the parent project's remote(s). A test has been added to enforce this behaviour and the BST_FORMAT_VERSION has been bumped.
Diffstat (limited to 'src/buildstream/_project.py')
-rw-r--r--src/buildstream/_project.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py
index 8d06c7cef..3a5923f80 100644
--- a/src/buildstream/_project.py
+++ b/src/buildstream/_project.py
@@ -645,6 +645,12 @@ class Project():
# Load artifacts pull/push configuration for this project
self.artifact_cache_specs = ArtifactCache.specs_from_config_node(config, self.directory)
+ # If there is a junction Element which specifies that we want to remotely cache
+ # its elements, append the junction's remotes to the artifact cache specs list
+ if self.junction and self.junction.cache_junction_elements:
+ parent = self.junction._get_project()
+ self.artifact_cache_specs = parent.artifact_cache_specs + self.artifact_cache_specs
+
# Load source caches with pull/push config
self.source_cache_specs = SourceCache.specs_from_config_node(config, self.directory)