Bug 16177

Summary: devtool/varhistory does not track overrides if used to include a file
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Peter Hoyes <Peter.Hoyes>
Component: devtools / tool chainAssignee: Ross Burton <ross.burton>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium CC: ccasciato, meta.mr.watcher, meta.watcher, randy.macleod
Version: unspecified   
Target Milestone: 6.1   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Peter Hoyes 2026-02-24 14:10:04 UTC
If patch files are added to SRC_URI conditionally using an override in a bbappend file, devtool detects this override and:
 * Creates a branch called `devtool-override-xxx` when running "devtool modify"
 * Populates the correct SRC_URI value with the patches in this branch when running "devtool finish"

If patch files are added in a .inc file that is conditionally included from a .bbappend file (e.g. https://git.yoctoproject.org/meta-arm/tree/meta-arm-bsp/recipes-bsp/u-boot/u-boot_%25.bbappend), then neither of the above happen. This makes it tricky to use devtool with recipes and machines that use this pattern. This pattern is used heavliy in meta-arm-bsp, and it useful particularly for firmware recipes which have many machine-specific customizations.

An initial investigation suggests the above is because devtool obtains its override metadata from varhistory, which doesn't track overrides through variables used for includes. This makes sense in theory I guess because include variables can contain arbitrarily complex variable expressions, not just overrides.

One way to (theoretically) make the problem more tractable might be to introduce overrides directly on require's, for this, e.g. "require:corstone1000 ${MACHINE_U-BOOT_REQUIRE}"...? This way the override context could (theoretically) be applied to everything in the required file.
Comment 1 Randy MacLeod 2026-02-26 15:39:01 UTC
Ross, Peter, 

Can you post to the bitbake list to see if we can start a discussion about the problem and potential solutions.