diff mbox series

features_check: warn about nodistro in message

Message ID 20251028115035.966245-1-contact@schnwalter.eu
State New
Headers show
Series features_check: warn about nodistro in message | expand

Commit Message

Walter Werner SCHNEIDER Oct. 28, 2025, 11:48 a.m. UTC
When a required distro feature is missing and DISTRO is set to nodistro,
provide a clear hint to the user. This helps newcomers starting projects
without a DISTRO configured who attempt to build images like
core-image-weston that depend on specific distro features.

Signed-off-by: Walter Werner SCHNEIDER <contact@schnwalter.eu>
---

This is related to my other patch that adds features_check to
core-image-weston. It improves the message a bit, so that newcomers
don't start adding DISTRO_FEATURES instead of setting a proper DISTRO
for their project.

 meta/classes-recipe/features_check.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/features_check.bbclass b/meta/classes-recipe/features_check.bbclass
index 1e0eaa4eed..4b0dcc9b97 100644
--- a/meta/classes-recipe/features_check.bbclass
+++ b/meta/classes-recipe/features_check.bbclass
@@ -42,8 +42,12 @@  python () {
         if required_features:
             missing = set.difference(required_features, features)
             if missing:
-                raise bb.parse.SkipRecipe("missing required %s feature%s '%s' (not in %s_FEATURES)"
-                    % (kind.lower(), 's' if len(missing) > 1 else '', ' '.join(missing), kind))
+                details = ''
+                if kind == 'DISTRO' and d.getVar('DISTRO') == 'nodistro':
+                    details = '; Did you forget to set DISTRO?'
+                raise bb.parse.SkipRecipe("missing required %s feature%s '%s' (not in %s_FEATURES%s)"
+                    % (kind.lower(), 's' if len(missing) > 1 else '', ' '.join(missing), kind, details))
+
 
         conflict_features = set((d.getVar('CONFLICT_' + kind + '_FEATURES') or '').split())
         if conflict_features: