[OE-core] in what recipe context can "bb" show me TOOLCHAIN_HOST_TASK?

Ulf Magnusson ulfalizer at gmail.com
Sat Oct 22 11:08:17 UTC 2016


Hello,

On Sat, Oct 22, 2016 at 9:39 AM, Robert P. J. Day <rpjday at crashcourse.ca> wrote:
>
>   a question about chris larson's nifty "bb" utility ... i recently
> figured out that, to get rpm-build into the SDK, i needed to add:
>
> TOOLCHAIN_HOST_TASK += "nativesdk-rpm-build"
>
> to my local.conf. now i'd like to use "bb" to display the full
> value of that variable, but i'm not sure what recipe context to use to
> do that. as in:
>
> $ bb show -r core-image-minimal TOOLCHAIN_HOST_TASK
> Parsing recipes..done.
> TOOLCHAIN_HOST_TASK=" nativesdk-rpm-build"
> $
>
> that just shows me what i appended. in what environment or recipe
> context could i run that command to get the full value of the variable
> when the SDK is being built?
>
> rday
>
> p.s. same question if i was using "bitbake -e".

You're seeing the final value of TOOLCHAIN_HOST_TASK (before any
changes to it within a single task anyway). To extend the default
value instead of replacing it, you would need to do the following
(note the space after the "):

  TOOLCHAIN_HOST_TASK_append = " nativesdk-rpm-build"

Below is an explanation of why this works:

Image recipes like core-image-minimal (indirectly) inherit
meta/classes/populate_sdk_base.bbclass, which sets the default value
of TOOLCHAIN_HOST_TASK as follows:

  TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host
packagegroup-cross-canadian-${MACHINE}"

Since the global configuration from .conf files like local.conf is
parsed before recipes (and the classes they inherit), using += means
that TOOLCHAIN_HOST_TASK will already have a value by the time the ?=
assignment is encountered, skipping the assignment. With _append, the
appending is delayed until the end of parsing, and the ?= assignment
won't be skipped.

I've submitted many changes to the 2.2 manuals that deal with
conceptual understanding by the way. If you're still reading the 2.1
manuals or earlier, you might want to switch.

 * To understand how variable "scopes" work in Yocto, see the note in
http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#usingpoky-debugging-viewing-variable-values.

 * To understand the motivation behind _append/_prepend/_remove, see
https://www.yoctoproject.org/docs/2.2/bitbake-user-manual/bitbake-user-manual.html#override-style-operation-advantages.

 * One of the notes in
http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#usingpoky-debugging-others
includes a recursive search helper that might be handy.

 * Should be documented in the manuals, but currently isn't: To see
which recipes inherit a particular class (either directly or
indirectly), you can use a command like the following one:

     $ bitbake-layers show-recipes -i populate_sdk_base

The TOOLCHAIN_HOST_TASK and TOOLCHAIN_TARGET_TASK variables could use
some more documentation. Submitting documentation suggestions to
https://bugzilla.yoctoproject.org/enter_bug.cgi?classification=Documentation
for stuff that's unnecessarily cryptic is highly appreciated.

Cheers,
Ulf



More information about the Openembedded-core mailing list