diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-09-11 14:41:29 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2025-09-19 07:03:31 -0700 |
commit | 15535d452d58fa55227d9d6f2048f075bf2b31a0 (patch) | |
tree | 95ecd0fe8569d11b095bd6052693efd3c0eb4cc3 /meta/classes/insane.bbclass | |
parent | d3568e56a74c93bc356c0180879ad2928bfb98b6 (diff) | |
download | poky-15535d452d58fa55227d9d6f2048f075bf2b31a0.tar.gz |
insane: Improve patch warning/error handling
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
(From OE-Core rev: 76a685bfcf927593eac67157762a53259089ea8a)
(From OE-Core rev: 4899961965d70281e63582234f0ed299431eff32)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3c3fd6a65e8103f74ae382d196d486b31a168b39)
The backported commit was modified to not mark "patch-fuzz" as an error
by default (which retains compatibility with kirkstone behaviour).
Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes/insane.bbclass')
-rw-r--r-- | meta/classes/insane.bbclass | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index f4b4c05e3d..99340c1752 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
@@ -1182,24 +1182,27 @@ python do_qa_patch() { | |||
1182 | msg += " devtool modify %s\n" % d.getVar('PN') | 1182 | msg += " devtool modify %s\n" % d.getVar('PN') |
1183 | msg += " devtool finish --force-patch-refresh %s <layer_path>\n\n" % d.getVar('PN') | 1183 | msg += " devtool finish --force-patch-refresh %s <layer_path>\n\n" % d.getVar('PN') |
1184 | msg += "Don't forget to review changes done by devtool!\n" | 1184 | msg += "Don't forget to review changes done by devtool!\n" |
1185 | if bb.utils.filter('ERROR_QA', 'patch-fuzz', d): | 1185 | msg += "\nPatch log indicates that patches do not apply cleanly." |
1186 | bb.error(msg) | ||
1187 | elif bb.utils.filter('WARN_QA', 'patch-fuzz', d): | ||
1188 | bb.warn(msg) | ||
1189 | msg = "Patch log indicates that patches do not apply cleanly." | ||
1190 | oe.qa.handle_error("patch-fuzz", msg, d) | 1186 | oe.qa.handle_error("patch-fuzz", msg, d) |
1191 | 1187 | ||
1192 | # Check if the patch contains a correctly formatted and spelled Upstream-Status | 1188 | # Check if the patch contains a correctly formatted and spelled Upstream-Status |
1193 | import re | 1189 | import re |
1194 | from oe import patch | 1190 | from oe import patch |
1195 | 1191 | ||
1192 | allpatches = False | ||
1193 | if bb.utils.filter('ERROR_QA', 'patch-status-noncore', d) or bb.utils.filter('WARN_QA', 'patch-status-noncore', d): | ||
1194 | allpatches = True | ||
1195 | |||
1196 | coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '') | 1196 | coremeta_path = os.path.join(d.getVar('COREBASE'), 'meta', '') |
1197 | for url in patch.src_patches(d): | 1197 | for url in patch.src_patches(d): |
1198 | (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url) | 1198 | (_, _, fullpath, _, _, _) = bb.fetch.decodeurl(url) |
1199 | 1199 | ||
1200 | # skip patches not in oe-core | 1200 | # skip patches not in oe-core |
1201 | patchtype = "patch-status-core" | ||
1201 | if not os.path.abspath(fullpath).startswith(coremeta_path): | 1202 | if not os.path.abspath(fullpath).startswith(coremeta_path): |
1202 | continue | 1203 | patchtype = "patch-status-noncore" |
1204 | if not allpatches: | ||
1205 | continue | ||
1203 | 1206 | ||
1204 | kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | re.MULTILINE) | 1207 | kinda_status_re = re.compile(r"^.*upstream.*status.*$", re.IGNORECASE | re.MULTILINE) |
1205 | strict_status_re = re.compile(r"^Upstream-Status: (Pending|Submitted|Denied|Accepted|Inappropriate|Backport|Inactive-Upstream)( .+)?$", re.MULTILINE) | 1208 | strict_status_re = re.compile(r"^Upstream-Status: (Pending|Submitted|Denied|Accepted|Inappropriate|Backport|Inactive-Upstream)( .+)?$", re.MULTILINE) |
@@ -1212,9 +1215,13 @@ python do_qa_patch() { | |||
1212 | 1215 | ||
1213 | if not match_strict: | 1216 | if not match_strict: |
1214 | if match_kinda: | 1217 | if match_kinda: |
1215 | bb.error("Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0))) | 1218 | msg = "Malformed Upstream-Status in patch\n%s\nPlease correct according to %s :\n%s" % (fullpath, guidelines, match_kinda.group(0)) |
1219 | oe.qa.handle_error(patchtype, msg, d) | ||
1216 | else: | 1220 | else: |
1217 | bb.error("Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines)) | 1221 | msg = "Missing Upstream-Status in patch\n%s\nPlease add according to %s ." % (fullpath, guidelines) |
1222 | oe.qa.handle_error(patchtype, msg, d) | ||
1223 | |||
1224 | oe.qa.exit_if_errors(d) | ||
1218 | } | 1225 | } |
1219 | 1226 | ||
1220 | python do_qa_configure() { | 1227 | python do_qa_configure() { |