diff options
authorMartin Jansa <>2013-07-06 20:50:14 +0200
committerMartin Jansa <>2014-06-04 01:12:28 +0200
commitb555b11fd240fcd3693c2163163bf61442af9dc1 (patch)
parent1ee9f1f58b03da43f9cddef3082e165fe6dc20bf (diff)
WIP: package.bbclass: add some pseudo-code to filter shlibs providers based on dependenciesjansa/shlib-providers
* when library/binary in package foo created by recipe is linked with library provided by package libabc created by recipe doesn't record foo -> libabc dependency if recipe foo doesn't depend on libabc * this should prevent non-deterministic shlibs providers when libabc metadata are changed or libabc doesn't exist anymore and foo package in sstate-cache still has libabc dependency. foo isn't rebuilt because it doesn't depend on libabc so stamps are still valid [YOCTO #4628] Signed-off-by: Martin Jansa <>
1 files changed, 25 insertions, 0 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 395621796a..edf1ec30fc 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1376,6 +1376,25 @@ python package_do_shlibs() {
# Take shared lock since we're only reading, not writing
lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"))
+ # WIP: this is more like pseudo-code of what I would like to do if possible
+ # Should return list of packages created by recipes which have their do_package task
+ # in dependency_tree of pn.do_package
+ def get_packages_from_dependency_tree(pn):
+ deps = get_recipes_dependent_on_from_task(pn, "do_package", "do_package")
+ return get_package_list(deps)
+ # WIP: this is more like pseudo-code of what I would like to do if possible
+ # Walks dependency tree of pn.task and returns list of pn acumulated from pn.task_dep found there
+ def get_dependency_tree(pn, task, task_dep):
+ # this doesn't include transitive dependencies or check for 'task' name
+ deps = d.getVar('DEPENDS', True)
+ return deps
+ # WIP: this is more like pseudo-code of what I would like to do if possible
+ # Reads pkgdata and return list of packages created by pn
+ def get_package_list(pn_list):
+ return pn_list
def read_shlib_providers():
list_re = re.compile('^(.*)\.list$')
# Go from least to most specific since the last one found wins
@@ -1580,6 +1599,8 @@ python package_do_shlibs() {
bb.debug(2, "calculating shlib requirements for %s" % pkg)
deps = list()
+ pn = d.getVar('PN', True)
+ allowed_deps = get_packages_from_dependency_tree(pn)
for n in needed[pkg]:
# if n is in private libraries, don't try to search provider for it
# this could cause problem in case some provides private
@@ -1597,6 +1618,10 @@ python package_do_shlibs() {
if dep_pkg == pkg:
+ if dep_pkg not in allowed_deps:
+ bb.warn("Skipping dependency on %s - shared library provider for %s, because %s doesn't have any dependency on it" % (dep_pkg, n, pn))
+ continue
if ver_needed:
dep = "%s (>= %s)" % (dep_pkg, ver_needed)