Message ID | DM8PR12MB5430DF7192F8D0BF7E6F2BE58B302@DM8PR12MB5430.namprd12.prod.outlook.com |
---|---|
State | New |
Headers | show |
Series | Bug with SkipRecipe and multiconfig | expand |
On Thu, 2024-12-05 at 20:24 +0000, chris.laplante@agilent.com wrote: > I believe I have tracked down a bug with SkipRecipe and multiconfig. > Before I submit a patch, I wanted to check my understanding of the > code and my suggested fix. > > The issue I observed is that when you have a recipe that is > incompatible (e.g. due to COMPATIBLE_MACHINE) with more than one > active multiconfig, including 'default', then BitBake will > inconsistently report why the recipe is unavailable. > [..] > > > Does this sound reasonable? Short summary is yes, it does. We retrofitted multiconfig to bitbake so this looks like something we just missed at the time. Cheers, Richard
Hi Richard, > > The issue I observed is that when you have a recipe that is > > incompatible (e.g. due to COMPATIBLE_MACHINE) with more than one > > active multiconfig, including 'default', then BitBake will > > inconsistently report why the recipe is unavailable. > > > [..] > > > > > > > Does this sound reasonable? > > Short summary is yes, it does. We retrofitted multiconfig to bitbake so this > looks like something we just missed at the time. OK, great. I'll work on a patch + selftest of some sort :). Thanks, Chris
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index b81e61fdb7..a639792504 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -560,7 +560,7 @@ python () { if re.match(need_machine, m): break else: - raise bb.parse.SkipRecipe("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE')) + raise bb.parse.SkipRecipe(f"incompatible with machine {d.getVar('MACHINE')} (not in COMPATIBLE_MACHINE), mc: {d.getVar('BB_CURRENT_MC')}") source_mirror_fetch = d.getVar('SOURCE_MIRROR_FETCH', False) or d.getVar('PARSE_ALL_RECIPES', False) if not source_mirror_fetch: diff --git a/meta/lib/oeqa/selftest/cases/multiconfig.py b/meta/lib/oeqa/selftest/cases/multiconfig.py index f509cbf607..c74bbd2fcf 100644 --- a/meta/lib/oeqa/selftest/cases/multiconfig.py +++ b/meta/lib/oeqa/selftest/cases/multiconfig.py @@ -85,3 +85,24 @@ BBMULTICONFIG = "muslmc" # Build a core-image-minimal, only dry run needed to check config is present bitbake('mc:muslmc:bash -n') + + def test_multiconfig_skip_recipe(self): + config = """ +BBMULTICONFIG = "musl" +""" + self.write_config(config) + + muslconfig = """ +MACHINE = "qemumips" +DISTRO = "poky" +TCLIBC = "musl" +TMPDIR = "${TOPDIR}/tmp-mc-musl" +""" + self.write_config(muslconfig, 'musl') + + # Write a recipe that is not compatible with qemux86-64 + self.write_recipeinc('m4', 'COMPATIBLE_MACHINE="qemuarm"') + + m = bitbake("m4 -n") + m = [line for line in m.output.splitlines() if "MACHINE=" in line] +