Re: [BuildStream] Element's variables in sources declarations



On Mon, 2019-09-09 at 09:36 +0000, Benjamin Schubert wrote:
Hey,

TLDR: I'm proposing to give sources access to their element's variables

I have been playing a bit more with BuildStream and encountered a few cases
where I would have the same variable repeated in multiple places.
It would be useful for users to be able to use element's variables in their
sources to remove that need. Moreover, as the 'variables' and the 'sources'
often live in the same file, it is natural to try using those variables.


Hi Benjamin,

All around +1

Not exposing the variables in sources is mostly just an oversight, I
don't see anything dangerous about this especially due to the
relationship between the Element and Source (sources cannot be shared),
of course this sort of ensures that we can never have a model where
elements can share sources, but I think the current ownership model is
fine (redundant sources might exist, but infrequently, and mostly does
not impose performance impacts except in rare cases when they are
simultaneously initially fetched).

One thing however I've been pondering is whether we want to keep
allowing plugins to access Node values without variable substitutions
at all.

This might be the right opportunity to finally just throw away the
Element.node_subst_member() API altogether, and have the substitutions
performed implicitly under the hood ?

Cheers,
    -Tristan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]