Bug 2951 - Review and remove unnecessary uses of _prepend/_append
Summary: Review and remove unnecessary uses of _prepend/_append
Status: NEW
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: 6.99
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-08-16 01:37 UTC by Christopher Larson
Modified: 2026-09-10 15:15 UTC (History)
8 users (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 Christopher Larson 2012-08-16 01:37:37 UTC
These postponed/lazy operations should only used when necessary, so +=/=+/.=/=. should be preferred for non-conditional operations.
Comment 1 Randy MacLeod 2021-06-10 15:14:20 UTC
Some cases are required so this will need careful auditing so only do a few files at a time before sending for review to the list. Thanks. Randy
Comment 2 Marco Cavallini 2021-07-20 07:19:31 UTC
For a newcomer, the description might be daunting. 
It would be better to describe better perhaps with an example of what types of substitutions are needed.
Comment 3 Randy MacLeod 2021-07-29 15:36:30 UTC
Chris can you please provide some examples and guidance?
Comment 4 Randy MacLeod 2021-08-19 15:09:23 UTC
Chris won't have time to work on this.
Comment 5 Randy MacLeod 2023-10-24 14:24:46 UTC
Bulk move from 4.99 or 0.00 to 5.99
Comment 6 Loc Nguyen 2023-11-08 03:58:55 UTC
Hi all, I'm a newcomer and would like to support for this bugfix. In my understanding, we will need to replace ":prepend/:append" to "+=/=+/.=/=.". Any suspicious case should be reported to this Bugzilla. Is my understanding correct?
Comment 7 Randy MacLeod 2023-11-16 20:09:08 UTC
Loc, Welcome to Yocto!

As was mentioned earlier, some cases of this are required so this will need careful auditing so only do a few files at a time before sending for review to the list.

Arbitrarily, you could start with:

poky.git on master
❯ rg :append meta/recipes-support/a* | wc -l
12

❯ rg :prepend meta/recipes-support/a* | wc -l
3


No additional bugzilla issues need to be opened unless someone requests one in the email list review.
"A journey of a thousand miles begins with a single step" and sometimes you start out in the wrong direction! ;-)  Make a small change, do some testing, send it out for review and iterate.
Thanks.
Comment 8 K Sanjay Nayak 2024-03-17 16:01:17 UTC
Hi Randy 

Can you please confirm is this issue is still valid? 

if yes, Then i would like to work on this..

Thanks for the inspiring quote! 

Thanks
Sanjay:)
Comment 9 Randy MacLeod 2024-03-19 18:18:12 UTC
As I was saying before, start small and simple and learn from feedback.

Ross Burton was saying that he'd be careful about what appends get changed so why don't you do 2 or 3 of the simpler appends from the list below, test them locally and send it to the list for review and autobuilder testing.


❯ rg "DEPEND.*:append =" meta/recipes*  | rg -v "@"
meta/recipes-extended/baremetal-example/baremetal-helloworld_git.bb:DEPENDS:qemux86:append = " nasm-native"
meta/recipes-extended/less/less_643.bb:RDEPENDS:${PN}-ptest:append = " perl-module-getopt-std perl-module-cwd locale-base-en-us"
meta/recipes-graphics/waffle/waffle_1.7.2.bb:DEPENDS:append = " python3"
meta/recipes-gnome/librsvg/librsvg_2.57.1.bb:BASEDEPENDS:append = " cargo-native"
meta/recipes-support/ptest-runner/ptest-runner_2.4.3.bb:RDEPENDS:${PN}:append = " pstree"
meta/recipes-support/libgpg-error/libgpg-error_1.48.bb:RDEPENDS:${PN}-ptest:append = " make bash"
meta/recipes-bsp/grub/grub-efi_2.12.bb:DEPENDS:append = " grub-native"
meta/recipes-core/sysvinit/sysvinit_3.04.bb:DEPENDS:append = " update-rc.d-native base-passwd virtual/crypt"
meta/recipes-core/initscripts/initscripts_1.0.bb:DEPENDS:append = " update-rc.d-native"

I've assigned the bug to Sanjay but feel free to co-ordinate the work with others if it turns out that there are lots of changes to review and tests rather than just mechanically search and replace.
Comment 10 Randy MacLeod 2024-09-10 18:56:49 UTC
Sanjay, do you plan to work on this enhancement this fall?
If so please move it to 5.2-M2. Thanks, Randy
Comment 11 Randy MacLeod 2026-09-10 15:15:00 UTC
Sanjay moved to unassigned, Take back if you work on it.