Bug 12538 - Using += with SDKIMAGE_FEATURES overrides the value of variable
Summary: Using += with SDKIMAGE_FEATURES overrides the value of variable
Status: RESOLVED NOTABUG
Alias: None
Product: eSDK
Classification: Yocto Project Subprojects
Component: eSDK (show other bugs)
Version: 2.5
Hardware: x86 x86
: Undecided normal
Target Milestone: ---
Assignee: Paul Eggleton
QA Contact: Francisco Pedraza
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-02-08 02:09 UTC by Anuj Mittal
Modified: 2018-02-08 16:10 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anuj Mittal 2018-02-08 02:09:34 UTC
Added this to local.conf:

SDKIMAGE_FEATURES += "staticdev-pkgs"

After that:

$ bitbake -c populate_sdk core-image-minimal -e | grep SDKIMAGE
# $SDKIMAGE_FEATURES [3 operations]
SDKIMAGE_FEATURES=" staticdev-pkgs"
# $SDKIMAGE_INSTALL_COMPLEMENTARY
#     "${@complementary_globs("SDKIMAGE_FEATURES", d)}"
SDKIMAGE_INSTALL_COMPLEMENTARY="*-staticdev"
    variables = ['BUILD_IMAGES_FROM_FEEDS','SDK_OS','SDK_OUTPUT','SDKPATHNATIVE','SDKTARGETSYSROOT','SDK_DIR','SDK_VENDOR','SDKIMAGE_INSTALL_COMPLEMENTARY','SDK_PACKAGE_ARCHS','SDK_OUTPUT',

Using _append works fine. Is this expected?
Comment 1 Ross Burton 2018-02-08 16:10:15 UTC
Don't use grep and you'll see the full context:

# $SDKIMAGE_FEATURES [3 operations]
#   append /home/ross/Yocto/poky/build/conf/local.conf:439
#     "staticdev-pkgs"
#   set /home/ross/Yocto/poky/meta/conf/documentation.conf:372
#     [doc] "Equivalent to IMAGE_FEATURES. However, this variable applies to the SDK generated from an image using the command 'bitbake -c populate_sdk imagename'."
#   set /home/ross/Yocto/poky/meta/classes/populate_sdk_base.bbclass:20
#     [_defaultval] "dev-pkgs dbg-pkgs ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'doc-pkgs', '', d)}"

The defaultval from populate_sdk_base is only used if there isn't a value set as it uses ??=.

So yes, it's by design that in local.conf you'll need to use _append.

(the same reasoning applies to DISTRO_FEATURES, IMAGE_FEATURES, and more)