All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <rpurdie@linux.intel.com>
To: "Tian, Kevin" <kevin.tian@intel.com>
Cc: Chris Larson <clarson@kergoth.com>,
	"poky@yoctoproject.org" <poky@yoctoproject.org>
Subject: Re: [PATCH 1/1] curl: fix native dependency
Date: Mon, 06 Dec 2010 01:04:17 +0000	[thread overview]
Message-ID: <1291597457.14277.2931.camel@rex> (raw)
In-Reply-To: <625BA99ED14B2D499DC4E29D8138F1504D475430EC@shsmsx502.ccr.corp.intel.com>

On Sun, 2010-12-05 at 17:32 +0800, Tian, Kevin wrote:
> >From: Chris Larson
> >Sent: Monday, November 29, 2010 11:25 PM
> >On Mon, Nov 29, 2010 at 5:25 AM, Richard Purdie <rpurdie@linux.intel.com> wrote:
> >> Interestingly though, if I add this to curl*.bb:
> >>
> >> FOO = "A"
> >> FOO_append = "B"
> >> FOO_append_virtclass-native = "C"
> >>
> >> and then "bitbake curl-native -e | grep FOO" (he recipe has a
> >> BBCLASSEXTEND native) what should I see?
> >>
> >> I see FOO = "AB" which is not what I thought it would do...
> >
> >Hmm, this isn't what I'd expect either.  It's certainly not what was
> >originally intended -- _append_<foo> and _prepend_<foo> were always
> >supposed to act like normal _append/_prepend, just conditional ones.

This is what I'd have expected too.

> I guess it's related to below lines (from finalize()):
> 
>                     # maybe the OVERRIDE was not yet added so keep the append
>                     if (o and o in overrides) or not o:
>                         self.delVarFlag(append, "_append")
>                     if o and not o in overrides:
>                         continue

Correct, it is these lines that are the problem.

> FOO_append = "B" is parsed into ("B", NONE)
> FOO_append_virtclass-native = "C" is parsed into ("C", virtclass-native)
> 
> If ("C", virtclass-native) is enumerated first, the result is desired: "C" is appended
> to FOO with ("B", NONE) simply removed.
> 
> If ("B", NONE) is enumerated first, then the rest appendixes are removed too which
> is not desired.

This is exactly the problem.

> The net effect is that the 1st appendix always takes effect over the rest unless it
> has an override which hasn't been found yet.

Right. I had a play with the code and can confirm a patch as follows
fixes this problem. I've also made it warn when it finds code that would
effect behaviour. For Poky its throwing up a warning about EXTRA_OEMAKE
but its actually fine as whilst there is an unexpanded override, there
is never any _append or _prepend to trigger this bug (the warning can
show false positives). It would be nice to see if OE is suffering from
this problem anywhere before we accept this fix into bitbake upstream.
I'll also remove this error before this goes into Poky.

http://git.pokylinux.org/cgit.cgi/poky-contrib/commit/?h=rpurdie/bitbake&id=c77410305fe736aa195ce720c8317b39da057052

> Besides this problem, there's also no consideration about override priority. It can't
> handle multiple overrides on same FOO_append.
> 
> To solve it, we still need to iterate override list from highest priority to lowest end,
> and then choose the value from the one firstly matching an override. My remote 
> machine is down now and thus unable to verify it though.

This is a good point but its not a simple one :)

FOO = "A"
FOO_append_OVERA = "B"
FOO_append_OVERB = "C"

could result in ABC or ACB depending on whether OVERA was added to
OVERRIDES late on. There isn't much we can probably do about that
though.

FOO = "A"
FOO_append_OVERA_OVERB = "B"
FOO_append_OVERB_OVERA = "C"

plain won't work at present if I read the code correctly. I'm not sure
there is an ordering constraint here though as "ABC" is the correct
answer and either an OVERRIDE is appended or it isn't and priority isn't
an issue?

Chris: Any thoughts on any of this?

Cheers,

Richard




  reply	other threads:[~2010-12-06  1:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-17  8:32 [PATCH 0/1] curl-native build fix Qing He
2010-11-17  8:26 ` [PATCH 1/1] curl: fix native dependency Qing He
2010-11-28 14:22   ` Richard Purdie
2010-11-29  5:26     ` Tian, Kevin
2010-11-29  5:53       ` Chris Larson
2010-11-29  5:58         ` Tian, Kevin
2010-11-29 12:25         ` Richard Purdie
2010-11-29 13:04           ` Frans Meulenbroeks
2010-11-29 15:17             ` Richard Purdie
2010-12-05  9:48               ` Tian, Kevin
2010-11-29 15:24           ` Chris Larson
2010-12-05  9:32             ` Tian, Kevin
2010-12-06  1:04               ` Richard Purdie [this message]
2010-12-07  7:55                 ` Tian, Kevin
2010-12-07 12:37                   ` Richard Purdie
2010-12-08  3:12                     ` Qing He
2010-12-09 15:16                       ` Richard Purdie
2010-12-13  5:52                         ` Qing He
2010-12-13 10:48                           ` Qing He
2010-11-30  1:44           ` Qing He
2010-12-05  9:43             ` Tian, Kevin
2010-12-06  1:10               ` Richard Purdie
2010-12-07  7:56                 ` Tian, Kevin
2010-11-29  8:17     ` Qing He
2010-11-29 11:57       ` Richard Purdie
2010-11-17 18:21 ` [PATCH 0/1] curl-native build fix Saul Wold
2010-11-17 18:26   ` Scott Garman
2010-11-19 22:43     ` Saul Wold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291597457.14277.2931.camel@rex \
    --to=rpurdie@linux.intel.com \
    --cc=clarson@kergoth.com \
    --cc=kevin.tian@intel.com \
    --cc=poky@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.