Pelagicore / meta-pelux

PELUX is an open source, GENIVI compliant development platform that supports the Qt Automotive Suite
https://pelux.io
MIT License
39 stars 28 forks source link

qtapplicationmanager-sc.inc: Replace += with _append #426

Closed JEderonn closed 4 years ago

JEderonn commented 4 years ago

If using += the behaviour is not defined in case the variable hasn't been set before bitbake parses this line. There is a risk that the variable is (re)set in the main recipe if _append is not used.

Signed-off-by: Johan Ederonn jederonn@luxoft.com

martin-ejdestig commented 4 years ago

Perhaps have the output of the environment for the two different cases in the commit message?

martin-ejdestig commented 4 years ago

With +=:

# $RDEPENDS_qtapplicationmanager [4 operations]
#   append /home/martin/Source/tech-office/build/build-intel-qtauto/../sources/meta-pelux/dynamic-layers/b2qt/recipes-qt/automotive/qtapplicationmanager-sc.inc:7
#     "${PN}-softwarecontainer"
#   rename from RDEPENDS_${PN} data.py:117 [expandKeys]
#     " ${PN}-softwarecontainer"
#   override[class-target]:set /home/martin/Source/tech-office/build/build-intel-qtauto/../sources/meta-boot2qt/meta-boot2qt/recipes-qt/automotive/qtapplicationmanager_git.bb:42
#     "libcrypto ${PN}-tools"
#   override[class-target]:rename from RDEPENDS_${PN}_class-target data_smart.py:644 [renameVar]
#     "libcrypto ${PN}-tools"
# pre-expansion value:
#   "libcrypto ${PN}-tools"
RDEPENDS_qtapplicationmanager="libcrypto qtapplicationmanager-tools"

With _append:

# $RDEPENDS_qtapplicationmanager [2 operations]
#   override[class-target]:set /home/martin/Source/tech-office/build/build-intel-qtauto/../sources/meta-boot2qt/meta-boot2qt/recipes-qt/automotive/qtapplicationmanager_git.bb:42
#     "libcrypto ${PN}-tools"
#   override[class-target]:rename from RDEPENDS_${PN}_class-target data_smart.py:644 [renameVar]
#     "libcrypto ${PN}-tools"
# pre-expansion value:
#   "libcrypto ${PN}-tools ${PN}-softwarecontainer"
RDEPENDS_qtapplicationmanager="libcrypto qtapplicationmanager-tools qtapplicationmanager-softwarecontainer"

I do not understand how += from a .bbappend can be applied after the = in a .bb. But having the above in the commit message makes it 100% clear what we have observed at least.

sashko commented 4 years ago

To my shame, I could never grasp the difference between them, but I have seen one or another crossing issues like overriding a variable instead of concatenating to its value.

DunderRoffe commented 4 years ago

I never knew this was a problem either... It all feels really weird :/

JEderonn commented 4 years ago

Commit message updated according to proposal from Martin.