diff options
Diffstat (limited to 'buildstream/element.py')
-rw-r--r-- | buildstream/element.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index 45bb983bb..e5bc0792e 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -1724,6 +1724,12 @@ class Element(Plugin): cache_buildtrees = context.cache_buildtrees build_success = buildresult[0] + # cache_buildtrees defaults to 'auto', only caching buildtrees + # when necessary, which includes failed builds. + # If only caching failed artifact buildtrees, then query the build + # result. Element types without a build-root dir will be cached + # with an empty buildtreedir regardless of this configuration. + if cache_buildtrees == 'always' or (cache_buildtrees == 'auto' and not build_success): try: sandbox_build_dir = sandbox_vroot.descend( |