[OE-core] question about order of processing SRC_URI items

Robert P. J. Day rpjday at crashcourse.ca
Thu Apr 21 13:39:16 UTC 2016


... some stuff snipped ...

On Thu, 21 Apr 2016, Richard Purdie wrote:

> On Thu, 2016-04-21 at 07:19 -0400, Robert P. J. Day wrote:

> >   more significantly, i realize the final order of SRC_URI items
> > depending on which one you use might be different, as "_append"
> > leaves the appending until the final stage of processing. so what
> > this tells me is that all of the items you list in SRC_URI should
> > *not* be order-dependent, is that a fair statement? or, IOW, if
> > your layer depends on the items in SRC_URI being processed in a
> > specific order, you probably need to rework your recipe file.
>
> Sometimes order is important, e.g. two patches which change the same
> set of files would need to be applied in the correct order.

  if i had that situation, i would think the obvious approach is that
those two patches should be bundled into the same .scc file, where
patch application ordering is preserved. my point was that i wouldn't
want to count on the ordering of items in the SRC_URI list itself.

> >   and, finally, given that you can have a combination of SRC_URI
> > assignments and appends in the same .bbappend file:
> >
> >   SRC_URI += "..."
> >   SRC_URI_append = "..."
> >   SRC_URI_append_<override> = "..."
> >
> > that tells me that you *really* don't want any of that to be
> > order-dependent, as i mentioned before.
>
> Right, you'd have to be careful with this.

  and that's the point i was making ... if you're mixing conditional
and unconditional SRC_URI appending, you *really* don't want to count
on any particular order of processing of the items in that variable.

  oh, one more thing related to coding style. given that .bb recipe
files are the foundation on which further .bbappend customization is
built, it would seem that .bb files should consistently use just:

  SRC_URI = "..."

and not

  SRC_URI += "..."

*unless* they're first including some .inc file that would set that
variable to some common initial value.

  i know it would make no difference in the end, but for me, it's a
visual thing -- when i see any use of "+=", i normally assume that
there might be some earlier value that's been assigned, so i take a
little more care in what i'm doing. so my coding style for new recipe
files would be to *always* use:

  SRC_URI = "..."

unless there was a good reason not to. and, yes, i am that pedantic.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================





More information about the Openembedded-core mailing list