From e77c5304401aba8bfe8d9e48d3f80c28d76adf58 Mon Sep 17 00:00:00 2001 From: Philip Lorenz Date: Mon, 28 Jul 2025 11:59:31 +0200 Subject: [PATCH] insane: Explicitly fail parsing if QA errors were raised So far, failing the build when a QA error was raised happened implicitly when another (unrelated) caller called `exit_if_errors` (e.g. insane.bbclass's anonymous Python function). This is error prone and may also lead to inconsistent abortion behaviour when parsing QA errors are only raised later. Fix this by introducing an explicit call to `exit_if_errors` once recipe parsing has finished. Currently code in the following .bbclasses relies on insane.bbclass to call `exit_if_errors`: * license.bbclass * yocto-check-layer.bbclass Signed-off-by: Philip Lorenz Signed-off-by: Mathieu Dubois-Briand --- meta/classes-global/base.bbclass | 4 ++++ meta/classes-global/insane.bbclass | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 6be1f5c2df..6fe37755ff 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass @@ -348,6 +348,10 @@ python base_eventhandler() { profprov = d.getVar("PREFERRED_PROVIDER_" + p) if profprov and pn != profprov: raise bb.parse.SkipRecipe("PREFERRED_PROVIDER_%s set to %s, not %s" % (p, profprov, pn)) + + # Bail out early if parsing raised any QA errors + oe.qa.exit_if_errors(d) + } CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate" diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass index fed8163c3e..f0b7f83e51 100644 --- a/meta/classes-global/insane.bbclass +++ b/meta/classes-global/insane.bbclass @@ -1627,6 +1627,4 @@ python () { if broken_order: oe.qa.handle_error("native-last", "%s: native/nativesdk class is not inherited last, this can result in unexpected behaviour. " "Classes inherited after native/nativesdk: %s" % (pn, " ".join(broken_order)), d) - - oe.qa.exit_if_errors(d) } -- 2.47.2