Filter elements don't work on stacks
Summary
Currently filter elements do not apply themselves to stack elements very well - as they are assembled by just grabbing the actual artifact of the immediate dependency, filters applied to stack elements produce an empty artifact.
Steps to reproduce
Simply create a chain of elements roughly like this:
[import, built elements or the like] <- Stack <- Filter
The artifact from the filter element will be empty regardless of includes and excludes.
What is the current bug behavior?
Filter elements applied to stack elements give no output
What is the expected correct behavior?
I would expect the filter to correctly filter the group of dependencies from the stack and give us an artifact that is the stack but with the includes/excludes applied. For a motivating example see freedesktop-sdk/freedesktop-sdk!1227 (closed) (we could use compose elements, but this causes a lot more hassle with overlaps), the current version of which also has a patched version of the 1.2.x plugin with this behaviour.
If this behaviour is deemed inconsistent for a filter element then I'd at least expect a failure when trying to build a filter element from a stack element.
Possible fixes
Handle stack dependencies here, either by staging all their dependencies or by raising an error in preflight.
Other relevant information
- BuildStream version affected: /milestone %BuildStream_v1.2