Bug 15130

Summary: bitbake should warn if a function is defined only for specific cases
Product: [Build System, Metadata & Runtime] BitBake Reporter: Trevor Gamblin <tgamblin>
Component: bitbakeAssignee: Trevor Gamblin <tgamblin>
Status: ACCEPTED --- QA Contact:
Severity: enhancement    
Priority: Medium+ CC: poky.bs.watcher, poky.watcher, randy.macleod
Version: unspecified   
Target Milestone: 6.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 Trevor Gamblin 2023-06-01 14:58:32 UTC
Related to https://bugzilla.yoctoproject.org/show_bug.cgi?id=15129, it is possible to define a function in class or recipe files with specific variants for target, native, etc. in such a way that a cryptic failure may be observed if there is no "default" version. For example, if:

foo_rm_bar:class-target () {
        ...
}

foo_rm_bar:class-native () {
        ...
}

then the following should also be present to handle other cases:

foo_rm_bar () {
        :
}

otherwise failures may occur that misleadingly suggest issues with the packages themselves. If functions are incompletely defined this way, bitbake should be able to warn the user.