]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
insane: Explicitly fail parsing if QA errors were raised
authorPhilip Lorenz <philip.lorenz@bmw.de>
Mon, 28 Jul 2025 09:59:31 +0000 (11:59 +0200)
committerMathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Wed, 30 Jul 2025 09:52:36 +0000 (11:52 +0200)
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 <philip.lorenz@bmw.de>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
meta/classes-global/base.bbclass
meta/classes-global/insane.bbclass

index 6be1f5c2df204e13700de360ecb14c552c50121c..6fe37755ffa13ff45fb8a44a901a5bd83d70f73e 100644 (file)
@@ -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"
index fed8163c3e09f2daf1260c3ef2773d115747a8e9..f0b7f83e51d9123b30cc4f61ed83824128787eea 100644 (file)
@@ -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)
 }