Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/3] insane: Improve patch warning/error handling
@ 2023-01-18 14:22 Richard Purdie
  2023-01-18 14:22 ` [PATCH 2/3] pseudo: Update to pull in linux-libc-headers race fix Richard Purdie
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Richard Purdie @ 2023-01-18 14:22 UTC (permalink / raw)
  To: openembedded-core

Currently, whilst patch errors or warnings are shown, the errors don't stop builds.
The configuration isn't very configurable from WARN_QA and ERROR_QA either.

This patch:
 * Uses the standard mechanisms to handle the patch fuzz warnings/errors
 * Makes Upstream-Status checking configurable from WARN/ERROR_QA
 * Allows that checking to be used with non-core layers
 * Makes patch-fuzz an error by default
 * Enables warnings for missing Upstream-Status in non-core layer patches by default

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes-global/insane.bbclass | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index ada8a7ef4e4..e1295f85392 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -29,11 +29,12 @@
 WARN_QA ?= " libdir xorg-driver-abi buildpaths \
             textrel incompatible-license files-invalid \
             infodir build-deps src-uri-bad symlink-to-sysroot multilib \
-            invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
+            invalid-packageconfig host-user-contaminated uppercase-pn \
             mime mime-xdg unlisted-pkg-lics unhandled-features-check \
             missing-update-alternatives native-last missing-ptest \
             license-exists license-no-generic license-syntax license-format \
             license-incompatible license-file-missing obsolete-license \
+            patch-status-noncore \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -44,6 +45,7 @@ ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             already-stripped installed-vs-shipped ldflags compile-host-path \
             install-host-path pn-overrides unknown-configure-option \
             useless-rpaths rpaths staticdev empty-dirs \
+            patch-fuzz patch-status-core\
             "
 # Add usrmerge QA check based on distro feature
 ERROR_QA:append = "${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)}"
@@ -1334,24 +1336,27 @@ python do_qa_patch() {
             msg += "    devtool modify %s\n" % d.getVar('PN')
             msg += "    devtool finish --force-patch-refresh %s <layer_path>\n\n" % d.getVar('PN')
             msg += "Don't forget to review changes done by devtool!\n"
-            if bb.utils.filter('ERROR_QA', 'patch-fuzz', d):
-                bb.error(msg)
-            elif bb.utils.filter('WARN_QA', 'patch-fuzz', d):
-                bb.warn(msg)
-            msg = "Patch log indicates that patches do not apply cleanly."
+            msg += "\nPatch log indicates that patches do not apply cleanly."
             oe.qa.handle_error("patch-fuzz", msg, d)
 
     # Check if the patch contains a correctly formatted and spelled Upstream-Status
     import re
     from oe import patch
 
+    allpatches = False
+    if bb.utils.filter('ERROR_QA', 'patch-status-noncore', d) or bb.utils.filter('WARN_QA', 'patch-status-noncore', d):
+        allpatches = True
+
     coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '')
     for url in patch.src_patches(d):
        (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url)
 
        # skip patches not in oe-core
+       patchtype = "patch-status-core"
        if not os.path.abspath(fullpath).startswith(coremeta_path):
-           continue
+           patchtype = "patch-status-noncore"
+           if not allpatches:
+               continue
 
        kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | re.MULTILINE)
        strict_status_re = re.compile(r"^Upstream-Status: (Pending|Submitted|Denied|Accepted|Inappropriate|Backport|Inactive-Upstream)( .+)?$", re.MULTILINE)
@@ -1364,9 +1369,13 @@ python do_qa_patch() {
 
            if not match_strict:
                if match_kinda:
-                   bb.error("Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0)))
+                   msg = "Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0))
+                   oe.qa.handle_error(patchtype, msg, d)
                else:
-                   bb.error("Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines))
+                   msg = "Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines)
+                   oe.qa.handle_error(patchtype, msg, d)
+
+    oe.qa.exit_if_errors(d)
 }
 
 python do_qa_configure() {
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2023-01-23  9:19 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-18 14:22 [PATCH 1/3] insane: Improve patch warning/error handling Richard Purdie
2023-01-18 14:22 ` [PATCH 2/3] pseudo: Update to pull in linux-libc-headers race fix Richard Purdie
2023-01-18 14:22 ` [PATCH 3/3] pseudo: Switch back to the master branch Richard Purdie
2023-01-18 16:46   ` [OE-core] " Luca Ceresoli
2023-01-18 17:04     ` Richard Purdie
2023-01-19  9:24 ` [OE-core] [PATCH 1/3] insane: Improve patch warning/error handling Luca Ceresoli
2023-01-19  9:57   ` Richard Purdie
2023-01-19 13:55     ` Bruce Ashfield
2023-01-19 14:40       ` Richard Purdie
2023-01-19 14:52         ` Bruce Ashfield
2023-01-19 14:55           ` Richard Purdie
2023-01-19 14:56       ` Ross Burton
2023-01-20 14:26         ` Bruce Ashfield
2023-01-20 19:10           ` Alexander Kanavin
2023-01-20 19:29             ` Bruce Ashfield
2023-01-20 19:38               ` Alexander Kanavin
2023-01-20 23:00                 ` Richard Purdie
2023-01-22 12:46                   ` Peter Kjellerstedt
2023-01-22 22:19                     ` Richard Purdie
2023-01-23  8:08                       ` Mikko Rapeli
2023-01-23  9:18                         ` Alexander Kanavin
     [not found] ` <173BAB83B1A056B8.24231@lists.openembedded.org>
2023-01-19  9:52   ` Luca Ceresoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox