Add element-level source cache
-
Add
ElementSourcesCache
Sources have been cached in CAS individually, except for sources that transform other sources, which have been cached together with all previous sources of the element. This caching structure may be confusing as sources are specified in the element as a list and this is not a good fit for #1274 where we want to support caching individual sources in a Remote Asset server with a BuildStream-independent URI (especially the
directory
configuration would be problematic).This replaces the combined caching of 'previous' sources with an element-level source cache, which caches all sources of an element staged together. Sources that don't depend on previous sources are still cached individually.
This also makes it possible to add a list of all element sources to the source proto used by the element-level source cache.
-
Move handling of the source
directory
configuration toElementSources
The
directory
value determines where a source is staged within the build root of an element, however, it does not directly affect individual sources.With this change the sources will individually be cached in CAS independent of the value of
directory
.ElementSources
will use the value ofdirectory
when staging all element sources into the build root.This results in a cache key change as the
directory
value is moved from the unique key of individual sources to the unique key ofElementSources
.