Bug 16256 - DISTRO_FEATURES_DEFAULTS is not appended to features in sanity checks
Summary: DISTRO_FEATURES_DEFAULTS is not appended to features in sanity checks
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: configuration (show other bugs)
Version: 6.0
Hardware: All Multiple
: Medium+ normal
Target Milestone: 6.0 M4
Assignee: Paul Barker
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-04-20 14:37 UTC by Louis Rannou
Modified: 2026-04-24 10:17 UTC (History)
1 user (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 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"