We need a way to make elements depend on a subset of an element's output
The problem: There are times when we want to depend on an element, but not stage all of its output. For example, an element built with autotools, where it enables an option based on what it finds in the filesystem, rather than having an option passed. We can't satisfactorily work around this with compose elements, because while we can split out the contents of an element's output appropriately, we lose dependency information.
e.g: foo.bst produces the split domain foo-dev.
bar.bst produces the split domain bar-dev.
bar depends on foo-dev to build - this is doable.
However, bar-dev is linked against foo-dev.
baz.bst build-depends on bar-dev.
bar-dev will not function because it cannot run-depend on foo-dev. A clumsy workaround is for baz to build-depend on both foo and bar, but this is in effect manually specifying the dependency link that ought to exist.
The proposed solution:
- Add an optional field to the depends section of Element, specifying a list of split domains to stage.
- Extend what Element.dependencies yields to include which split domains to stage.
- Expand Element.dependencies'
visited
dict to also store depended-upon split domains, so that we only yield an element's split domain once.
Points worth thinking about:
- Will this affect future plans to make rebuilds happen only if a subset of an element changes?