summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Watt <JPEWhacker@gmail.com>2024-12-10 10:32:19 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-12-12 12:55:56 +0000
commit9b80c039add2bdd7ed70774a4c379030df6538a5 (patch)
treece4f4e6ee2a26a31797d069580390aac4d313e4f
parentf417b86214ae726ce85fac39f2b1c2e22e32b9d5 (diff)
downloadpoky-9b80c039add2bdd7ed70774a4c379030df6538a5.tar.gz
classes-global/insane: Handle case where RPROVIDER is also a provider
The check to see if a provider of a given package is listed first checks for an exact match of the provider name. However, if this match existed, but didn't match in the task dependencies, it would not continue to look for other providers of package. This would manifest if one (non-virtual) recipe package RPROVIDES the name of a package produced by another recipe. Fix this, and also clean up the code to make it more readable by using a function to check if a runtime dependency is in the task dependencies. In addition, if no provider is found, list all the possible providers instead of the last one that was looked at. (From OE-Core rev: f13de6ab616eb1e38960a2296111febe2a9f4a28) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-global/insane.bbclass21
1 files changed, 13 insertions, 8 deletions
diff --git a/meta/classes-global/insane.bbclass b/meta/classes-global/insane.bbclass
index e54d2c1508..866cef6526 100644
--- a/meta/classes-global/insane.bbclass
+++ b/meta/classes-global/insane.bbclass
@@ -825,6 +825,12 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d):
825 825
826 # Now do the sanity check!!! 826 # Now do the sanity check!!!
827 if "build-deps" not in skip: 827 if "build-deps" not in skip:
828 def check_rdep(rdep_data, possible_pn):
829 if rdep_data and "PN" in rdep_data:
830 possible_pn.add(rdep_data["PN"])
831 return rdep_data["PN"] in taskdeps
832 return False
833
828 for rdepend in rdepends: 834 for rdepend in rdepends:
829 if "-dbg" in rdepend and "debug-deps" not in skip: 835 if "-dbg" in rdepend and "debug-deps" not in skip:
830 error_msg = "%s rdepends on %s" % (pkg,rdepend) 836 error_msg = "%s rdepends on %s" % (pkg,rdepend)
@@ -833,17 +839,16 @@ def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d):
833 error_msg = "%s rdepends on %s" % (pkg, rdepend) 839 error_msg = "%s rdepends on %s" % (pkg, rdepend)
834 oe.qa.handle_error("dev-deps", error_msg, d) 840 oe.qa.handle_error("dev-deps", error_msg, d)
835 if rdepend not in packages: 841 if rdepend not in packages:
842 possible_pn = set()
836 rdep_data = oe.packagedata.read_subpkgdata(rdepend, d) 843 rdep_data = oe.packagedata.read_subpkgdata(rdepend, d)
837 if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps: 844 if check_rdep(rdep_data, possible_pn):
838 continue 845 continue
839 if not rdep_data or not 'PN' in rdep_data: 846
840 for _, rdep_data in oe.packagedata.foreach_runtime_provider_pkgdata(d, rdepend): 847 if any(check_rdep(rdep_data, possible_pn) for _, rdep_data in oe.packagedata.foreach_runtime_provider_pkgdata(d, rdepend)):
841 if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps:
842 break
843 if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps:
844 continue 848 continue
845 if rdep_data and 'PN' in rdep_data: 849
846 error_msg = "%s rdepends on %s, but it isn't a build dependency, missing %s in DEPENDS or PACKAGECONFIG?" % (pkg, rdepend, rdep_data['PN']) 850 if possible_pn:
851 error_msg = "%s rdepends on %s, but it isn't a build dependency, missing one of %s in DEPENDS or PACKAGECONFIG?" % (pkg, rdepend, ", ".join(possible_pn))
847 else: 852 else:
848 error_msg = "%s rdepends on %s, but it isn't a build dependency?" % (pkg, rdepend) 853 error_msg = "%s rdepends on %s, but it isn't a build dependency?" % (pkg, rdepend)
849 oe.qa.handle_error("build-deps", error_msg, d) 854 oe.qa.handle_error("build-deps", error_msg, d)