bitbake: bblayers/query: Add --show-variants option to display BBCLASSEXTEND variants
PATCH 1/1 bitbake: bblayers/query: Add --show-variants option to display BBCLASSEXTEND variants
The bitbake-layers show-recipes command was hiding BBCLASSEXTEND recipe variants (e.g., devupstream, nativesdk, cross-canadian) by design, to avoid clutter in the output. However, this made it impossible to see recipes like linux-firmware's devupstream variant which uses git snapshots instead of release tarballs.
This patch adds a new --show-variants (-v) option to show-recipes that allows users to view all BBCLASSEXTEND variants when needed, while maintaining the default behavior of hiding them for a cleaner output.
Example usage:
bitbake-layers show-recipes -v linux-firmware
This will now show both:
- Base version: 1:20251011
- Devupstream version: 1:20251011+git
--- bitbake/lib/bblayers/query.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
bitbake/lib/bblayers/query.py +16 -7
@@ -52,7 +52,7 @@ layer, with the preferred version first. Note that skipped recipes that are overlayed will also be listed, with a " (skipped)" suffix. """ - items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None, args.mc) + items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None, args.mc, False) # Check for overlayed .bbclass files classes = collections.defaultdict(list)
@@ -119,9 +119,9 @@ skipped recipes will also be listed, with a " (skipped)" suffix. title = 'Matching recipes:' else: title = 'Available recipes:' - self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, args.layer, args.bare, inheritlist, args.mc) + self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, args.layer, args.bare, inheritlist, args.mc, args.show_variants) - def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_recipes_only, show_multi_provider_only, selected_layer, bare, inherits, mc): + def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_recipes_only, show_multi_provider_only, selected_layer, bare, inherits, mc, show_variants=False): if inherits: bbpath = str(self.tinfoil.config_data.getVar('BBPATH')) for classname in inherits:
@@ -203,8 +203,10 @@ skipped recipes will also be listed, with a " (skipped)" suffix. # We only display once per recipe, we should prefer non extended versions of the # recipe if present (so e.g. in OpenEmbedded, openssl rather than nativesdk-openssl # which would otherwise sort first). + # However, if show_variants is True, we show all BBCLASSEXTEND variants. if realfn[1] and realfn[0] in self.tinfoil.cooker.recipecaches[mc].pkg_fn: - continue + if not show_variants: + continue if inherits: matchcount = 0
@@ -229,7 +231,11 @@ skipped recipes will also be listed, with a " (skipped)" suffix. for prov in allproviders[p]: provfile = bb.cache.virtualfn2realfn(prov[1])[0] provlayer = self.get_file_layer(provfile) - provs.append((provfile, provlayer, prov[0])) + # When show_variants is True, use the virtual filename to distinguish BBCLASSEXTEND variants + if show_variants: + provs.append((prov[1], provlayer, prov[0])) + else: + provs.append((provfile, provlayer, prov[0])) if provlayer != preflayer: multilayer = True if prov[0] != pref[0]:
@@ -238,10 +244,12 @@ skipped recipes will also be listed, with a " (skipped)" suffix. if not items_listed: logger.plain('=== %s ===' % title) items_listed = True + # When show_variants is True, use the virtual filename for preference check + pref_cmp_file = pref[1] if show_variants else preffile print_item(preffile, p, self.version_str(pref[0][0], pref[0][1]), preflayer, True) for (provfile, provlayer, provver) in provs: - if provfile != preffile: - print_item(provfile, p, self.version_str(provver[0], provver[1]), provlayer, False) + if provfile != pref_cmp_file: + print_item(bb.cache.virtualfn2realfn(provfile)[0] if show_variants else provfile, p, self.version_str(provver[0], provver[1]), provlayer, False) # Ensure we don't show two entries for BBCLASSEXTENDed recipes preffiles.append(preffile)
@@ -530,6 +538,7 @@ NOTE: .bbappend files can impact the dependencies. parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='') parser_show_recipes.add_argument('-l', '--layer', help='only list recipes from the selected layer', default='') parser_show_recipes.add_argument('-b', '--bare', help='output just names without the "(skipped)" marker', action='store_true') + parser_show_recipes.add_argument('-v', '--show-variants', help='show all BBCLASSEXTEND recipe variants (e.g., devupstream, nativesdk)', action='store_true') parser_show_recipes.add_argument('--mc', help='use specified multiconfig', default='') parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')
Signature · 1 line
2.43.0
Quoted 6 lines
-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Osama Abdelkader via lists.openembedded.org
Sent: den 24 oktober 2025 18:40
To: [email protected]; [email protected]
Cc: Osama Abdelkader <[email protected]>
Subject: [OE-core] [PATCH] bitbake: bblayers/query: Add --show-variants option to display BBCLASSEXTEND variants
This should go to the [email protected] list instead. And drop the "bitbake:" prefix from the subject. It is added by combo-layer when updating the poky repository.
Quoted 28 lines
The bitbake-layers show-recipes command was hiding BBCLASSEXTEND recipe variants (e.g., devupstream, nativesdk, cross-canadian) by design, to avoid clutter in the output. However, this made it impossible to see recipes like linux-firmware's devupstream variant which uses git snapshots instead of release tarballs.
This patch adds a new --show-variants (-v) option to show-recipes that allows users to view all BBCLASSEXTEND variants when needed, while maintaining the default behavior of hiding them for a cleaner output.
Example usage:
bitbake-layers show-recipes -v linux-firmwareThis will now show both:
- Base version: 1:20251011
- Devupstream version: 1:20251011+gitSigned-off-by Osama Abdelkader <[email protected]>--- bitbake/lib/bblayers/query.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)bitbake/lib/bblayers/query.py +0
-0
bitbake/lib/bblayers/query.py layer, with the preferred version first. Note that skipped recipes that · line 55
Quoted 5 lines
bitbake/lib/bblayers/query.py +1
-1@@ -52,7 +52,7 @@ layer, with the preferred version first. Note that skipped recipes that are overlayed will also be listed, with a " (skipped)" suffix. """ - items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None, args.mc) + items_listed = self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None, args.mc, False)
Since False is the default for show_variants, there is no add it here explicitly.
Quoted 64 lines
bitbake/lib/bblayers/query.py +15
-7# Check for overlayed .bbclass files classes = collections.defaultdict(list)@@ -119,9 +119,9 @@ skipped recipes will also be listed, with a " (skipped)" suffix. title = 'Matching recipes:' else: title = 'Available recipes:' - self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, args.layer, args.bare, inheritlist, args.mc) + self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, args.layer, args.bare, inheritlist, args.mc, args.show_variants) - def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_recipes_only, show_multi_provider_only, selected_layer, bare, inherits, mc): + def list_recipes(self, title, pnspec, show_overlayed_only, show_same_ver_only, show_filenames, show_recipes_only, show_multi_provider_only, selected_layer, bare, inherits, mc, show_variants=False): if inherits: bbpath = str(self.tinfoil.config_data.getVar('BBPATH')) for classname in inherits:@@ -203,8 +203,10 @@ skipped recipes will also be listed, with a " (skipped)" suffix. # We only display once per recipe, we should prefer non extended versions of the # recipe if present (so e.g. in OpenEmbedded, openssl rather than nativesdk-openssl # which would otherwise sort first). + # However, if show_variants is True, we show all BBCLASSEXTEND variants. if realfn[1] and realfn[0] in self.tinfoil.cooker.recipecaches[mc].pkg_fn: - continue + if not show_variants: + continue if inherits: matchcount = 0@@ -229,7 +231,11 @@ skipped recipes will also be listed, with a " (skipped)" suffix. for prov in allproviders[p]: provfile = bb.cache.virtualfn2realfn(prov[1])[0] provlayer = self.get_file_layer(provfile) - provs.append((provfile, provlayer, prov[0])) + # When show_variants is True, use the virtual filename to distinguish BBCLASSEXTEND variants + if show_variants: + provs.append((prov[1], provlayer, prov[0])) + else: + provs.append((provfile, provlayer, prov[0])) if provlayer != preflayer: multilayer = True if prov[0] != pref[0]:@@ -238,10 +244,12 @@ skipped recipes will also be listed, with a " (skipped)" suffix. if not items_listed: logger.plain('=== %s ===' % title) items_listed = True + # When show_variants is True, use the virtual filename for preference check + pref_cmp_file = pref[1] if show_variants else preffile print_item(preffile, p, self.version_str(pref[0][0], pref[0][1]), preflayer, True) for (provfile, provlayer, provver) in provs: - if provfile != preffile: - print_item(provfile, p, self.version_str(provver[0], provver[1]), provlayer, False) + if provfile != pref_cmp_file: + print_item(bb.cache.virtualfn2realfn(provfile)[0] if show_variants else provfile, p, self.version_str(provver[0], provver[1]), provlayer, False) # Ensure we don't show two entries for BBCLASSEXTENDed recipes preffiles.append(preffile)@@ -530,6 +538,7 @@ NOTE: .bbappend files can impact the dependencies. parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='') parser_show_recipes.add_argument('-l', '--layer', help='only list recipes from the selected layer', default='') parser_show_recipes.add_argument('-b', '--bare', help='output just names without the "(skipped)" marker', action='store_true') + parser_show_recipes.add_argument('-v', '--show-variants', help='show all BBCLASSEXTEND recipe variants (e.g., devupstream, nativesdk)', action='store_true') parser_show_recipes.add_argument('--mc', help='use specified multiconfig', default='') parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)') --
Quoted 1 line
2.43.0
//Peter
Quoted 131 lines · Osama Abdelkader via lists.openembedded.org
The bitbake-layers show-recipes command was hiding BBCLASSEXTEND recipe
variants (e.g., devupstream, nativesdk, cross-canadian) by design, to avoid clutter in the output. However, this made it impossible to see recipes like linux-firmware's devupstream variant which uses git snapshots
instead of release tarballs.This patch adds a new --show-variants (-v) option to show-recipes that
allows users to view all BBCLASSEXTEND variants when needed, while maintaining the default behavior of hiding them for a cleaner output.Example usage:
bitbake-layers show-recipes -v linux-firmwareThis will now show both:
- Base version: 1:20251011
- Devupstream version: 1:20251011+gitSigned-off-by Osama Abdelkader <[email protected]>---
bitbake/lib/bblayers/query.py | 23 ++++++++++++++++-------1 file changed, 16 insertions(+), 7 deletions(-)bitbake/lib/bblayers/query.py +0
-0@@ -52,7 +52,7 @@ layer, with the preferred version first. Note thatskipped recipes that
are overlayed will also be listed, with a " (skipped)" suffix. """
-items_listed= self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None, args.mc)
+items_listed= self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None, args.mc, False)
# Check for overlayed .bbclass files
classes =collections.defaultdict(list)bitbake/lib/bblayers/query.py +0
-0@@ -119,9 +119,9 @@ skipped recipes will also be listed, with a "(skipped)" suffix.
title = 'Matching recipes:'
else:
title = 'Available recipes:'
- self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, args.layer, args.bare, inheritlist, args.mc)
+ self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, args.layer, args.bare, inheritlist, args.mc, args.show_variants)
- def list_recipes(self, title, pnspec,show_overlayed_only,show_same_ver_only,show_filenames,show_recipes_only,show_multi_provider_only,selected_layer, bare, inherits, mc):
+ def list_recipes(self, title, pnspec,show_overlayed_only,show_same_ver_only,show_filenames,show_recipes_only,show_multi_provider_only,selected_layer, bare, inherits, mc, show_variants=False):
if inherits:
bbpath = str(self.tinfoil.config_data.getVar('BBPATH')) for classname in inherits:bitbake/lib/bblayers/query.py +0
-0@@ -203,8 +203,10 @@ skipped recipes will also be listed, with a "(skipped)" suffix.
# We only display once per recipe, we should prefer non extended versions of the# recipe if present (so e.g. in OpenEmbedded, openssl rather than nativesdk-openssl # which would otherwise sort first). + # However, if show_variants is True, we show all BBCLASSEXTEND variants. if realfn[1] and realfn[0] in self.tinfoil.cooker.recipecaches[mc].pkg_fn: - continue + if not show_variants: + continue if inherits: matchcount = 0bitbake/lib/bblayers/query.py +0
-0@@ -229,7 +231,11 @@ skipped recipes will also be listed, with a "(skipped)" suffix.
for prov in allproviders[p]:
provfile = bb.cache.virtualfn2realfn(prov[1])[0]
provlayer =self.get_file_layer(provfile)-provs.append((provfile, provlayer, prov[0]))+ # Whenshow_variantsis True, use the virtual filename to distinguish BBCLASSEXTEND variants
+ ifshow_variants:
+provs.append((prov[1], provlayer, prov[0]))
+ else:
+provs.append((provfile, provlayer, prov[0]))
if provlayer != preflayer:
multilayer = True
if prov[0] != pref[0]:bitbake/lib/bblayers/query.py +0
-0@@ -238,10 +244,12 @@ skipped recipes will also be listed, with a "(skipped)" suffix.
if notitems_listed:
logger.plain('=== %s ===' % title)items_listed= True
+ # Whenshow_variantsis True, use the virtual filename for preference check
+pref_cmp_file= pref[1] ifshow_variantselse preffile
print_item(preffile, p, self.version_str(pref[0][0], pref[0][1]), preflayer, True)for (provfile, provlayer, provver) in provs:
- if provfile != preffile:
-print_item(provfile, p, self.version_str(provver[0], provver[1]), provlayer, False)+ if provfile !=pref_cmp_file:
+
print_item(bb.cache.virtualfn2realfn(provfile)[0] ifshow_variantselse provfile, p,self.version_str(provver[0], provver[1]), provlayer, False)
# Ensure we don't show two entries for BBCLASSEXTENDed recipes
preffiles.append(preffile)bitbake/lib/bblayers/query.py +0
-0@@ -530,6 +538,7 @@ NOTE: .bbappend files can impact thedependencies.
parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='')
Quoted 8 lines
parser_show_recipes.add_argument('-l', '--layer', help='only list recipes from the selected layer', default='')parser_show_recipes.add_argument('-b', '--bare', help='output just names without the "(skipped)" marker', action='store_true')
+ parser_show_recipes.add_argument('-v', '--show-variants', help='show all BBCLASSEXTEND recipe variants (e.g., devupstream, nativesdk)', action='store_true')
During the patch review session, we concluded that -v usually stands for “verbose” or often for “version.” Would it be possible to remove -v for this somewhat more specific feature and only keep the long option?
Thank you.
Adrian
Quoted 17 lines
parser_show_recipes.add_argument('--mc', help='use specified multiconfig', default='')parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#225300):
https://lists.openembedded.org/g/openembedded-core/message/225300
Mute This Topic: https://lists.openembedded.org/mt/115931358/4454582
Group Owner: [email protected] Unsubscribe:
https://lists.openembedded.org/g/openembedded-core/unsub [
[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 138 lines · On Mon, Dec 08, 2025 at 06:28:12PM +0100, [email protected] wrote:
Quoted 136 lines · Osama Abdelkader via lists.openembedded.org
The bitbake-layers show-recipes command was hiding BBCLASSEXTEND recipe
variants (e.g., devupstream, nativesdk, cross-canadian) by design, to avoid clutter in the output. However, this made it impossible to see recipes like linux-firmware's devupstream variant which uses git snapshots
instead of release tarballs.This patch adds a new --show-variants (-v) option to show-recipes that
allows users to view all BBCLASSEXTEND variants when needed, while maintaining the default behavior of hiding them for a cleaner output.Example usage:
bitbake-layers show-recipes -v linux-firmwareThis will now show both:
- Base version: 1:20251011
- Devupstream version: 1:20251011+gitSigned-off-by Osama Abdelkader <[email protected]>---
bitbake/lib/bblayers/query.py | 23 ++++++++++++++++-------1 file changed, 16 insertions(+), 7 deletions(-)bitbake/lib/bblayers/query.py +0
-0@@ -52,7 +52,7 @@ layer, with the preferred version first. Note thatskipped recipes that
are overlayed will also be listed, with a " (skipped)" suffix. """
-items_listed= self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None, args.mc)
+items_listed= self.list_recipes('Overlayed recipes', None, True, args.same_version, args.filenames, False, True, None, False, None, args.mc, False)
# Check for overlayed .bbclass files
classes =collections.defaultdict(list)bitbake/lib/bblayers/query.py +0
-0@@ -119,9 +119,9 @@ skipped recipes will also be listed, with a "(skipped)" suffix.
title = 'Matching recipes:'
else:
title = 'Available recipes:'
- self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, args.layer, args.bare, inheritlist, args.mc)
+ self.list_recipes(title, args.pnspec, False, False, args.filenames, args.recipes_only, args.multiple, args.layer, args.bare, inheritlist, args.mc, args.show_variants)
- def list_recipes(self, title, pnspec,show_overlayed_only,show_same_ver_only,show_filenames,show_recipes_only,show_multi_provider_only,selected_layer, bare, inherits, mc):
+ def list_recipes(self, title, pnspec,show_overlayed_only,show_same_ver_only,show_filenames,show_recipes_only,show_multi_provider_only,selected_layer, bare, inherits, mc, show_variants=False):
if inherits:
bbpath = str(self.tinfoil.config_data.getVar('BBPATH')) for classname in inherits:bitbake/lib/bblayers/query.py +0
-0@@ -203,8 +203,10 @@ skipped recipes will also be listed, with a "(skipped)" suffix.
# We only display once per recipe, we should prefer non extended versions of the# recipe if present (so e.g. in OpenEmbedded, openssl rather than nativesdk-openssl # which would otherwise sort first). + # However, if show_variants is True, we show all BBCLASSEXTEND variants. if realfn[1] and realfn[0] in self.tinfoil.cooker.recipecaches[mc].pkg_fn: - continue + if not show_variants: + continue if inherits: matchcount = 0bitbake/lib/bblayers/query.py +0
-0@@ -229,7 +231,11 @@ skipped recipes will also be listed, with a "(skipped)" suffix.
for prov in allproviders[p]:
provfile = bb.cache.virtualfn2realfn(prov[1])[0]
provlayer =self.get_file_layer(provfile)-provs.append((provfile, provlayer, prov[0]))+ # Whenshow_variantsis True, use the virtual filename to distinguish BBCLASSEXTEND variants
+ ifshow_variants:
+provs.append((prov[1], provlayer, prov[0]))
+ else:
+provs.append((provfile, provlayer, prov[0]))
if provlayer != preflayer:
multilayer = True
if prov[0] != pref[0]:bitbake/lib/bblayers/query.py +0
-0@@ -238,10 +244,12 @@ skipped recipes will also be listed, with a "(skipped)" suffix.
if notitems_listed:
logger.plain('=== %s ===' % title)items_listed= True
+ # Whenshow_variantsis True, use the virtual filename for preference check
+pref_cmp_file= pref[1] ifshow_variantselse preffile
print_item(preffile, p, self.version_str(pref[0][0], pref[0][1]), preflayer, True)for (provfile, provlayer, provver) in provs:
- if provfile != preffile:
-print_item(provfile, p, self.version_str(provver[0], provver[1]), provlayer, False)+ if provfile !=pref_cmp_file:
+
print_item(bb.cache.virtualfn2realfn(provfile)[0] ifshow_variantselse provfile, p,self.version_str(provver[0], provver[1]), provlayer, False)
# Ensure we don't show two entries for BBCLASSEXTENDed recipes
preffiles.append(preffile)bitbake/lib/bblayers/query.py +0
-0@@ -530,6 +538,7 @@ NOTE: .bbappend files can impact thedependencies.
parser_show_recipes.add_argument('-i', '--inherits', help='only list recipes that inherit the named class(es) - separate multiple classes using , (without spaces)', metavar='CLASS', default='')
parser_show_recipes.add_argument('-l', '--layer', help='only list recipes from the selected layer', default='')parser_show_recipes.add_argument('-b', '--bare', help='output just names without the "(skipped)" marker', action='store_true')
Quoted 9 lines
Quoted 3 lines
+ parser_show_recipes.add_argument('-v', '--show-variants', help='show all BBCLASSEXTEND recipe variants (e.g., devupstream, nativesdk)', action='store_true')
During the patch review session, we concluded that -v usually stands for “verbose” or often for “version.” Would it be possible to remove -v for this somewhat more specific feature and only keep the long option?
Sure, I'm going to send v2.
Thanks,
Osama
Quoted 20 lines
Thank you.
AdrianQuoted 17 lines
parser_show_recipes.add_argument('--mc', help='use specified multiconfig', default='')parser_show_recipes.add_argument('pnspec', nargs='*', help='optional recipe name specification (wildcards allowed, enclose in quotes to avoid shell expansion)')-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#225300):
https://lists.openembedded.org/g/openembedded-core/message/225300
Mute This Topic: https://lists.openembedded.org/mt/115931358/4454582
Group Owner: [email protected] Unsubscribe:
https://lists.openembedded.org/g/openembedded-core/unsub [
[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-