Re: [BuildStream] Specifying default dependencies for element kinds



Hi Sander,

On Thu, 2019-06-13 at 11:32 +0200, Sander Striker wrote:
Hi,

TL;DR let's try to minimize the syntactic sugar required in .bst files for list composition.

On Thu, Jun 13, 2019 at 10:31 AM Tristan Van Berkom via buildstream-list <buildstream-list gnome org> 
wrote:
[...]
On Thu, 2019-06-13 at 08:17 +0200, Jürg Billeter wrote:
[...]
I agree that the default composition behavior for lists is not ideal in
this case.

[...] 
Indeed, it's not ideal in this specific case that the overlaying
dictionary need to be aware of whether or not the underlying exists or
not, if they want to append/prepend.

Perhaps we could introduce an error-free prepend/append semantic:

  foo:
    (->):
    - append or create list
    - if doesn't already exist

But I admit this would look a bit like voodoo if it was used in every
dependency list declaration in build elements in the project.

That would be something that we should avoid.  Just like trying to
avoid includes in every build element, it should be possible for the
build elements themselves to be clean/minimal.
 
Any better ideas ?

Make error free append the default operation (even when it is not
specified).  Which means that in the common case you don't need any
syntactic sugar.  And use overwrites in your elements for the cases
where you need to be very explicit, ignoring project.conf.

+1, I like this a lot.

That said, it may be worth some thought experiments to figure out what
protections we might lose with this (off hand it seems dangerous to me
to change the "error to append to non-existing list" to be the
opposite, but I could be wrong).

It also seems that it would not present difficulties in porting
BuildStream 1 projects - as it would technically be a compatible
change.

Cheers,
    -Tristan



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