Skip to contentSkip to conversation

in what recipe context can "bb" show me TOOLCHAIN_HOST_TASK?

DISCUSSION Robert P. J. Day 2 participants 3 messages Oct 22, 2016

lore
Share & tools
lore
#0 lore raw

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".

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#1 lore raw

Hello,

Quoted 15 lines · Robert P. J. Day

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"
$
Quoted 7 lines

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

#2 lore raw
Quoted 26 lines · Ulf Magnusson

Hello,

Quoted 15 lines · Robert P. J. Day

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"
$
Quoted 7 lines

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".

Quoted 8 lines

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:

actually, i just noticed that a few minutes ago. i'm well aware of
the difference in processing between += and _append, it just didn't occur to me to see if there was a difference at the time. duh.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

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