From: Khem Raj <raj.khem@gmail.com>
To: Ulf Magnusson <ulfalizer@gmail.com>
Cc: OE Core mailing list <openembedded-core@lists.openembedded.org>
Subject: Re: subtle weirdness when you combine "_append" with "+="?
Date: Tue, 16 Aug 2016 09:39:05 -0700 [thread overview]
Message-ID: <92B4EF25-FE41-4310-B78A-554EA37BF507@gmail.com> (raw)
In-Reply-To: <CAFkk2KSVc3rqAieBHzkayJQT7YHxJhYoD0PSqp-YFL0CYMLkvg@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2774 bytes --]
> On Aug 16, 2016, at 8:56 AM, Ulf Magnusson <ulfalizer@gmail.com> wrote:
>
> On Tue, Aug 16, 2016 at 5:49 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>> On Tue, 16 Aug 2016, Ulf Magnusson wrote:
>>
>>> On Tue, Aug 16, 2016 at 4:02 PM, Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>>>>
>>>> was about to submit a small number of patches to clean up redundancy
>>>> when people combine "_append" with "+=" (because it offends my
>>>> delicate sensibilities), and ran across this in oe-core,
>>>> unfs3_0.9.22.r497.bb:
>>>>
>>>> DEPENDS_append_class-nativesdk += "flex-nativesdk"
>>>>
>>>> uh, what?
>>>>
>>>> most of the time, i assume the above doesn't hurt, it's just ...
>>>> silly. but normally, with "_append", you *need* to add the leading
>>>> space explicitly, and that's not being done above. so does that mean
>>>> that combining "_append" with "+=" *does* generate a leading space?
>>>> that just makes my head hurt -- the possibility that "_append" is
>>>> being used in a way that normally makes it fail, only to have "+="
>>>> step in and save the day. at which point "_append" saves processing
>>>> that until the end of parsing? yeesh.
>>>>
>>>> thoughts?
>>>
>>> By the point the += is handled, the override won't have been interpreted
>>> yet. My guess is that += fetches the value of the variable
>>> "DEPENDS_append_class-nativesdk", gets back the empty string, and
>>> adds a space followed by "flex-nativesdk" to that.
>>>
>>> The resulting " flex-nativesdk" is then interpreted as usual when the
>>> overrides are handled.
>>>
>>> You might like the note I added to
>>> https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#override-style-operation-advantages
>>> by the way. :)
>>
>> that note is pretty much what i've been whining about for a long
>> time. :-) in any event, when one sees something like the above:
>
> The intent of the note was to discourage use of '+=' together with _append,
> because it's redundant and potentially confusing. Do you think it fails
> (even in context)? :/
the _append/_prepend in conjunction with += is a undocumented behavior
however, I do not see it as much a side effect. But in future bitbake may
silently change its behavior, so I agree its always good to stay in safe
waters.
>
>>
>> DEPENDS_append_class-nativesdk += "flex-nativesdk"
>>
>> what is the *proper* cleanup?
>
> I'd say the following:
>
> DEPENDS_append_class-nativesdk = " flex-nativesdk"
>
> Cheers,
> Ulf
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]
next prev parent reply other threads:[~2016-08-16 16:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-16 14:02 subtle weirdness when you combine "_append" with "+="? Robert P. J. Day
2016-08-16 14:46 ` Ulf Magnusson
2016-08-16 15:49 ` Robert P. J. Day
2016-08-16 15:56 ` Ulf Magnusson
2016-08-16 16:39 ` Khem Raj [this message]
2016-08-17 13:21 ` Robert P. J. Day
2016-08-17 14:14 ` Ulf Magnusson
2016-08-17 14:23 ` Robert P. J. Day
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=92B4EF25-FE41-4310-B78A-554EA37BF507@gmail.com \
--to=raj.khem@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=ulfalizer@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox