Bug 16256

Summary: DISTRO_FEATURES_DEFAULTS is not appended to features in sanity checks
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Louis Rannou <louis.rannou>
Component: configurationAssignee: Paul Barker <paul>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: randy.macleod
Version: 6.0   
Target Milestone: 6.0 M4   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Louis Rannou 2026-04-20 14:37:50 UTC
Since commit 3194d6868dd14e40ae670db089e5bf6f862d3044 (meta: Support opting out of any machine features) [1], DISTRO_FEATURES is appended with DISTRO_FEATURES_DEFAULTS when filter_defaults_features from utils.py is called.

In sanity checks, the filter is not called and the variable DISTRO_FEATURES is not finalized.

Several layers have such a sanity check: https://github.com/ni/meta-security/blob/nilrt/master/scarthgap/classes/sanity-meta-security.bbclass, https://github.com/rauc/meta-rauc/blob/master/classes-global/sanity-meta-rauc.bbclass

As an example, the rauc sanity check will raise a warning when 'rauc' in declared in DISTRO_FEATURES_DEFAULTS but not in DISTRO_FEATURES.

What is the expected behaviour in this case ?

[1]: https://git.openembedded.org/openembedded-core/commit/?id=3194d6868dd14e40ae670db089e5bf6f862d3044
Comment 1 Randy MacLeod 2026-04-23 14:41:26 UTC
Paul and Richard have found some problems with how DISTRO_FEATURES* work.
patches in master-next help but not completely.
Comment 2 Paul Barker 2026-04-24 10:17:46 UTC
This appears to be fixed after commit 6b553a5042b9 ("base/bitbake.conf: Rework DISTRO_FEATURES and MACHINE_FEATURES default handling") [1].

[1]: https://git.openembedded.org/openembedded-core/commit/?id=6b553a5042b9d5828a9da675ede16e10f06dae90

Tested by adding the meta-security layer, then setting in local.conf:

DISTRO_FEATURES_DEFAULTS += "security"