Filter elements can't be checked-out because it checks out the depended-upon element instead

Summary

While checking out a filter element, I appear to be redirecting the element to the element it build-depends on, instead.

Steps to reproduce

  1. Go to tests/plugins/filter/basic
  2. Execute bst build output-include.bst
  3. Execute bst checkout output-include.bst tmp
  4. Execute ls tmp

What is the current bug behavior?

Every file produced by input.bst is checked-out ('foo', 'bar' and 'baz')

What is the expected correct behavior?

Only the file 'foo' is checked-out

Relevant logs and/or screenshots

bst checkout output-include.bst test
[--:--:--][][] START   Loading pipeline
[00:00:00][][] SUCCESS Loading pipeline
[--:--:--][][] START   Resolving pipeline
[00:00:00][][] SUCCESS Resolving pipeline
[--:--:--][][] START   Resolving cached state
[00:00:00][][] SUCCESS Resolving cached state
[--:--:--][][] INFO    Element 'output-include.bst' redirected to 'input.bst'
[--:--:--][][] START   Staging dependencies
[00:00:00][][] SUCCESS Staging dependencies
[--:--:--][][] START   Integrating sandbox
[00:00:00][][] SUCCESS Integrating sandbox
[--:--:--][][] START   Checking out files in test
[00:00:00][][] SUCCESS Checking out files in test

Possible fixes

In _pipeline.py:217, get_selection, elements are redirected if mode == PipelineSelection.NONE

In _stream.py:370, checkout, we load the pipeline without specifying any PipelineSelection modes, so it defaults to NONE.

I have a ready-made branch which contains a proposed solution to this.

Other relevant information

  • BuildStream version affected: /milestone %BuildStream_v1.1

Edited by Jonathan Maw