Re: [yocto] pedantic nitpickery: coding style with "FILESEXTRAPATHS:prepend"
"Robert P. J. Day" <[email protected]>
| Newsgroups | org.yoctoproject.lists.yocto |
|---|---|
| Message-ID | <[email protected]> |
On Tue, 28 Oct 2025, Martin Jansa wrote: > On Tue, Oct 28, 2025 at 2:14 PM Leon Woestenberg via > lists.yoctoproject.org <[email protected]> > wrote: > > > > On Tue, Oct 28, 2025 at 12:37 PM Robert P. J. Day via > > lists.yoctoproject.org <[email protected]> > > wrote: > > > > > > (spoiler: turns out this is fine, but it's non-intuitive) > > > arm-ffa-transport.inc:FILESEXTRAPATHS:prepend := "${ARMFILESPATHS}" > > > linux-yocto%.bbappend:ARMFILESPATHS := "${THISDIR}/files:" > > > > Indeed, I would have written this, as the trailing double colon is > > needed in the prepend context of using the variable. > > > > arm-ffa-transport.inc:FILESEXTRAPATHS:prepend := "${ARMFILESPATHS}:" > > linux-yocto%.bbappend:ARMFILESPATHS := "${THISDIR}/files" > > > > But as you said, it works, so that's typically enough barrier to keep as-is. > > I agree, but only until there is an exception where you don't want to > prepend anything (by setting ARMFILESPATHS to empty) and then having > extra double colon will be worse than the currently used syntax. > Similarly when there are multiple paths in ARMFILESPATHS variable and > first one will need own double colon as separator, but the last one > not. In all cases bitbake-getvar or bitbake -e is your friend (when > git grep isn't enough). i didn't mean to make such a big deal of a triviality, but martin explained it in a way that made me realize why this bothered me so much -- it's that by adding that trailing colon in the setting of ARMFILESPATHS, you're making an assumption that it will only ever be used in a context like prepending, and in no other context. so, sure, it works fine in the current, very localized situation, but it's not generalizable to use that variable elsewhere. anyway, i'll shut up now. rday