From: Martin Jansa Date: Thu, 13 Jun 2024 14:18:52 +0000 (+0200) Subject: qa.py: handle_error: use bb.utils.contains to avoid depending on whole ERROR_QA/WARN_... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccb13779808a017293591e0e27e84a194f5f4da0;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git qa.py: handle_error: use bb.utils.contains to avoid depending on whole ERROR_QA/WARN_QA variable Comparing fmt-native.do_recipe_qa in 2 DISTROs with different ERROR_QA Variable ERROR_QA value changed: @@ -1,4 +1,3 @@ -dev-so debug-deps dev-deps debug-files arch pkgconfig la perms dep-cmp pkgvarcheck perm-config perm-line perm-link split-strip packages-list pkgv-undefined var-undefined version-going-backwards expanded-d invalid-chars license-checksum dev-elf file-rdeps configure-unsafe configure-gettext perllocalpod shebang-size 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 webos-enh-sub-warning webos-enh-sub-error acg-dirty acg-json ${WEBOS_ERROR_QA_AUTOREV} acg-api acg-perm ls2-role ls2-schema ${DEFAULT_WARN_QA} patch-status${@bb.utils.contains('DISTRO_FEATURES', 'webos-dac', 'perm-file', '', d)} incomp-lic-no-whitelist-error${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)} +dev-so debug-deps dev-deps debug-files arch pkgconfig la perms dep-cmp pkgvarcheck perm-config perm-line perm-link split-strip packages-list pkgv-undefined var-undefined version-going-backwards expanded-d invalid-chars license-checksum dev-elf file-rdeps configure-unsafe configure-gettext perllocalpod shebang-size 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 webos-enh-sub-warning webos-enh-sub-error acg-dirty acg-json ${WEBOS_ERROR_QA_AUTOREV} acg-api acg-perm ls2-role ls2-schema ${DEFAULT_WARN_QA} patch-status${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', ' usrmerge', '', d)} DISTRO_FEATURES{usrmerge} = Unset -DISTRO_FEATURES{webos-dac} = Unset _remove of version-going-backwards Shows that whole ERROR_QA/WARN_QA value is included in do_recipe_qa signature, that's because: if error_class in (d.getVar("ERROR_QA") or "").split(): will just include whole ERROR_QA variable as dependency while bb.utils.contains() is optimized to only depend on the item being included in the variable or not, see: https://git.openembedded.org/bitbake/commit/?id=ed2d0a22a80299de0cfd377999950cf4b26c512e https://git.openembedded.org/bitbake/commit/?id=0b9d117631ce909312d53b93289e61defc6be01c https://git.openembedded.org/bitbake/commit/?id=5156b4bb6876dac636be9726df22c8ee792714dd [YOCTO #15515] Signed-off-by: Martin Jansa --- diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py index f8ae3c743ff..6040862bb12 100644 --- a/meta/lib/oe/qa.py +++ b/meta/lib/oe/qa.py @@ -187,12 +187,12 @@ def write_error(type, error, d): f.write("%s: %s [%s]\n" % (p, error, type)) def handle_error(error_class, error_msg, d): - if error_class in (d.getVar("ERROR_QA") or "").split(): + if bb.utils.contains('ERROR_QA', error_class, True, False, d): write_error(error_class, error_msg, d) bb.error("QA Issue: %s [%s]" % (error_msg, error_class)) d.setVar("QA_ERRORS_FOUND", "True") return False - elif error_class in (d.getVar("WARN_QA") or "").split(): + elif bb.utils.contains('WARN_QA', error_class, True, False, d): write_error(error_class, error_msg, d) bb.warn("QA Issue: %s [%s]" % (error_msg, error_class)) else: