diff options
Diffstat (limited to 'buildstream/plugins/elements/filter.py')
-rw-r--r-- | buildstream/plugins/elements/filter.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/buildstream/plugins/elements/filter.py b/buildstream/plugins/elements/filter.py index 1c1a59b76..8ce16ff9f 100644 --- a/buildstream/plugins/elements/filter.py +++ b/buildstream/plugins/elements/filter.py @@ -32,6 +32,10 @@ they must be runtime dependencies only. This can be useful to propagate runtime dependencies forward from this filter element onto its reverse dependencies. +When workspaces are opened, closed or reset on this element, or this +element is tracked, instead of erroring due to a lack of sources, this +element will transparently pass on the command to its sole build-dependency. + The default configuration and possible options are as such: .. literalinclude:: ../../../buildstream/plugins/elements/filter.yaml :language: yaml @@ -103,6 +107,13 @@ class FilterElement(Element): exclude=self.exclude, orphans=self.include_orphans) return "" + def _get_source_element(self): + # Filter elements act as proxies for their sole build-dependency + build_deps = list(self.dependencies(Scope.BUILD, recurse=False)) + assert len(build_deps) == 1 + output_elm = build_deps[0]._get_source_element() + return output_elm + def setup(): return FilterElement |