From: Fawzi KHABER <[email protected]>

Add a package QA check for when a package RRECOMMENDS another that won't
be built because it is empty and ALLOW_EMPTY is not set. This happens
usually when ${PN}-dev RRECOMMENDS ${PN} but ${PN} is empty. This is not
an error but might be something to look into.

Example of a generated warning:
WARNING: python3-3.11.2-r0 do_package_qa:
QA Issue: python3-dev -> python3 but won't be build [rrecommends-non-existant]

This will make [YOCTO #8222] appears in the QA logs.

Signed-off-by: Yoann Congal <[email protected]>
Signed-off-by: Fawzi KHABER <[email protected]>
---
 meta/classes-global/insane.bbclass | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/meta/classes-global/insane.bbclass 
b/meta/classes-global/insane.bbclass
index ee34d5208d..a3e8c57955 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -34,6 +34,7 @@ WARN_QA ?= " libdir xorg-driver-abi buildpaths \
             missing-update-alternatives native-last missing-ptest \
             license-exists license-no-generic license-syntax license-format \
             license-incompatible license-file-missing obsolete-license \
+            rrecommends-non-existant \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -1089,6 +1090,16 @@ def package_qa_check_empty_dirs(pkg, d, messages):
             msg = "%s installs files in %s, %s" % (pkg, dir, recommendation)
             oe.qa.add_message(messages, "empty-dirs", msg)
 
+QAPKGTEST[rrecommends-non-existant] = 
"package_qa_check_rrecommends_non_existant"
+def package_qa_check_rrecommends_non_existant(pkg, d, messages):
+    localdata = bb.data.createCopy(d)
+    localdata.setVar('OVERRIDES', pkg)
+    for rec in bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS") 
or ""):
+        if rec in (d.getVar("PACKAGES") or "").split() and not 
os.listdir(os.path.join(d.getVar("PKGDEST"), rec)):
+            localdata.setVar("OVERRIDES", rec)
+            if not bb.utils.to_boolean(localdata.getVar("ALLOW_EMPTY"), False):
+                oe.qa.add_message(messages, "rrecommends-non-existant", "{0} 
-> {1} but won't be build".format(pkg, rec))
+
 def package_qa_check_encoding(keys, encode, d):
     def check_encoding(key, enc):
         sane = True
-- 
2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#177641): 
https://lists.openembedded.org/g/openembedded-core/message/177641
Mute This Topic: https://lists.openembedded.org/mt/97195661/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to