Bug 15276

Summary: perf: setting PACKAGECONFIG in .bbappend does not work as expected
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Rasmus Villemoes <rasmus.villemoes>
Component: kernelAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: Medium+ CC: randy.macleod, tom.zanussi
Version: unspecified   
Target Milestone: 5.1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Rasmus Villemoes 2023-11-07 08:23:19 UTC
See https://lore.kernel.org/all/27439f1c-a64d-41a0-815e-882a1a9a5b4d@prevas.dk/ .

The problem is that the line

inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}

ends up doing an immediate expansion of PACKAGECONFIG, so if one tries to set PACKAGECONFIG in a .bbappend, the value used in the inherit line (i.e. the weak default set in the recipe) does include the word "python".

If the final PACKAGECONFIG value set in the .bbappend file does not, the dependency machinery does not pull in python.

That shouldn't be a problem, except that it is, because perf's build system behaves differently when there is a PYTHON variable in the environment (which there is, because the recipe has implicitly inherited python3native, which does 'export PYTHON'). So the build actually breaks.
Comment 1 Richard Purdie 2024-08-07 16:16:44 UTC
Fixed with the addition of inherit_defer:

https://git.yoctoproject.org/poky/commit/meta/recipes-kernel/perf?id=c917323a39da6fc3e8d92b2fe907d0357149c9bb