summaryrefslogtreecommitdiff
path: root/buildstream/_stream.py
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2018-07-17 13:05:51 +0100
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-07-18 15:07:24 +0900
commitdc17de387961ba54c4742ba504ba7314c7da16aa (patch)
treec7f225c3586ee02419a4be03e288bd604af1020d /buildstream/_stream.py
parent7229d2e5d03227f174ac359fd1a73ef50c071c5a (diff)
downloadbuildstream-dc17de387961ba54c4742ba504ba7314c7da16aa.tar.gz
Clean the artifact cache when we hit the cache quota
When the cache quota is hit, we will remove any elements not required for the current build, until our cache is only filled halfway.
Diffstat (limited to 'buildstream/_stream.py')
-rw-r--r--buildstream/_stream.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/buildstream/_stream.py b/buildstream/_stream.py
index a29d8b63f..34baa0b05 100644
--- a/buildstream/_stream.py
+++ b/buildstream/_stream.py
@@ -876,6 +876,14 @@ class Stream():
selected,
except_elements)
+ # Set the "required" artifacts that should not be removed
+ # while this pipeline is active
+ #
+ # FIXME: The set of required artifacts should probably be
+ # what's in `selected`, but this does not seem to work
+ # for some reason
+ self._artifacts.append_required_artifacts((e for e in self._pipeline.dependencies(elements, Scope.ALL)))
+
if selection == PipelineSelection.PLAN and dynamic_plan:
# We use a dynamic build plan, only request artifacts of top-level targets,
# others are requested dynamically as needed.