Bug 14991

Summary: When forcing WARN_QA as ERROR_QA patch-fuzz QA checks are not fatal
Product: [Build System, Metadata & Runtime] Meta-yocto Reporter: Mathew Prokos <mathew.prokos>
Component: meta-yoctoAssignee: Mathew Prokos <mathew.prokos>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: poky.bs.watcher, poky.watcher, randy.macleod
Version: 4.2   
Target Milestone: 4.3 M2   
Hardware: All   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: New (Never tested)
Verified: Documentation change: No (bug/feature does not impact docs)

Description Mathew Prokos 2022-12-16 00:10:38 UTC
We treat all WARN_QA as ERROR_QA by adding this line to the local.conf

ERROR_QA:append = " ${WARN_QA}"

In this case it would be the same as moving patch-fuzz into the ERROR_QA list.


When there are patch-fuzz QA errors the build correctly fails however not before sstate is populated. Subsequent builds will then pass using the stored sstate entries.


This patch is based on dunfell but almost identical patches could be applied to main. Other QA checks follow this same pattern checking for qa_sane before calling bb.fatal. 

+---
+ meta/classes/insane.bbclass | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
+index eb19425..87431ae 100644
+--- a/meta/classes/insane.bbclass
++++ b/meta/classes/insane.bbclass
+@@ -1169,6 +1169,9 @@ python do_qa_patch() {
+                 bb.warn(msg)
+             msg = "Patch log indicates that patches do not apply cleanly."
+             package_qa_handle_error("patch-fuzz", msg, d)
++    qa_sane = d.getVar("QA_SANE")
++    if not qa_sane:
++        bb.fatal("Fatal QA errors found, failing task.")
+ }
+
+ python do_qa_configure() {
+--
+2.38.1
+
Comment 1 Randy MacLeod 2022-12-22 15:37:31 UTC
For your approach to work, you should also do:
WARN_QA = ""

The code should also check if there is any duplication in ERROR_QA and WARN_QA and if so, exit with an error most likely.
Also see: #14620 which is usually how warnings get lost.

Are you able to send a patch to the list to fix this?
Comment 2 Randy MacLeod 2023-06-22 15:12:01 UTC
Mathew, is this fixed in master now by:
https://git.yoctoproject.org/poky/commit/meta/classes-global/insane.bbclass?id=3c3fd6a65e8103f74ae382d196d486b31a168b39

We don't think it's sensible to backport to previous branches. 
-- YP bug review