| Message ID | 20251029135419.12883-1-contact@schnwalter.eu |
|---|---|
| State | New |
| Headers | show |
| Series | [v2] features_check: warn about nodistro in message | expand |
Hi Walter, Can you rewrite the commit message to reflect what the new code does? Cheers, Ross > On 29 Oct 2025, at 13:48, Walter Werner SCHNEIDER via lists.openembedded.org <contact=schnwalter.eu@lists.openembedded.org> wrote: > > 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> > --- > v1 -> v2: Changed the error message. > > As pointed out by others, the message might not be technically correct, > but I think it's good enough for new users, experienced users will know > that they can either update the DISTRO_FEATURES or use a different > DISTRO, new users will start asking question why they have "nodistro" > and wether or not that has something to do with the missing > DISTRO_FEATURES. This is how the error message used to look like: > > ERROR: Nothing PROVIDES 'core-image-weston' > core-image-weston was skipped: missing required distro feature 'wayland' > (not in DISTRO_FEATURES) > > And now it looks like this: > > ERROR: Nothing PROVIDES 'core-image-weston' > core-image-weston was skipped: using DISTRO 'nodistro', which is missing > required DISTRO_FEATURES: 'wayland' > > > > meta/classes-recipe/features_check.bbclass | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/meta/classes-recipe/features_check.bbclass b/meta/classes-recipe/features_check.bbclass > index 1e0eaa4eed..36ed4fa4be 100644 > --- a/meta/classes-recipe/features_check.bbclass > +++ b/meta/classes-recipe/features_check.bbclass > @@ -42,8 +42,13 @@ 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)) > + if kind == 'DISTRO': > + raise bb.parse.SkipRecipe("using %s '%s', which is missing required %s_FEATURES: '%s'" > + % (kind, d.getVar(kind), kind, ' '.join(missing))) > + else: > + raise bb.parse.SkipRecipe("missing required %s_FEATURES: '%s'" > + % (kind, ' '.join(missing))) > + > > conflict_features = set((d.getVar('CONFLICT_' + kind + '_FEATURES') or '').split()) > if conflict_features: > > -=-=-=-=-=-=-=-=-=-=-=- > Links: You receive all messages sent to this group. > View/Reply Online (#225456): https://lists.openembedded.org/g/openembedded-core/message/225456 > Mute This Topic: https://lists.openembedded.org/mt/116012468/6875888 > Group Owner: openembedded-core+owner@lists.openembedded.org > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ross.burton@arm.com] > -=-=-=-=-=-=-=-=-=-=-=- >
diff --git a/meta/classes-recipe/features_check.bbclass b/meta/classes-recipe/features_check.bbclass index 1e0eaa4eed..36ed4fa4be 100644 --- a/meta/classes-recipe/features_check.bbclass +++ b/meta/classes-recipe/features_check.bbclass @@ -42,8 +42,13 @@ 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)) + if kind == 'DISTRO': + raise bb.parse.SkipRecipe("using %s '%s', which is missing required %s_FEATURES: '%s'" + % (kind, d.getVar(kind), kind, ' '.join(missing))) + else: + raise bb.parse.SkipRecipe("missing required %s_FEATURES: '%s'" + % (kind, ' '.join(missing))) + conflict_features = set((d.getVar('CONFLICT_' + kind + '_FEATURES') or '').split()) if conflict_features:
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> --- v1 -> v2: Changed the error message. As pointed out by others, the message might not be technically correct, but I think it's good enough for new users, experienced users will know that they can either update the DISTRO_FEATURES or use a different DISTRO, new users will start asking question why they have "nodistro" and wether or not that has something to do with the missing DISTRO_FEATURES. This is how the error message used to look like: ERROR: Nothing PROVIDES 'core-image-weston' core-image-weston was skipped: missing required distro feature 'wayland' (not in DISTRO_FEATURES) And now it looks like this: ERROR: Nothing PROVIDES 'core-image-weston' core-image-weston was skipped: using DISTRO 'nodistro', which is missing required DISTRO_FEATURES: 'wayland' meta/classes-recipe/features_check.bbclass | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)