From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [RFC][PATCH 4/4] WIP: package.bbclass: add some pseudo-code to filter shlibs providers based on dependencies
Date: Sun, 7 Jul 2013 01:13:07 +0200 [thread overview]
Message-ID: <1373152387-19393-4-git-send-email-Martin.Jansa@gmail.com> (raw)
In-Reply-To: <1373152387-19393-1-git-send-email-Martin.Jansa@gmail.com>
* when library/binary in package foo created by recipe foo.bb is linked
with library libabc.so provided by package libabc created by recipe libabc.bb
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 <Martin.Jansa@gmail.com>
---
meta/classes/package.bbclass | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 3713fd3..72d5f43 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1354,6 +1354,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
@@ -1547,6 +1566,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 in shlib_provider.keys():
(dep_pkg, ver_needed) = shlib_provider[n]
@@ -1556,6 +1577,10 @@ python package_do_shlibs() {
if dep_pkg == pkg:
continue
+ 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)
else:
--
1.8.2.1
next prev parent reply other threads:[~2013-07-06 23:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-06 23:13 [RFC][PATCH 1/4] package.bbclass: move reading shlibs providers to separate function Martin Jansa
2013-07-06 23:13 ` [RFC][PATCH 2/4] package.bbclass: show warning when package is trying to provide already provided shlib Martin Jansa
2013-07-10 11:51 ` Martin Jansa
2013-07-06 23:13 ` [RFC][PATCH 3/4] package.bbclass: add SHLIBSSEARCHDIRS to define where to search for shlib providers Martin Jansa
2013-09-02 11:22 ` Richard Purdie
2013-09-02 11:27 ` Martin Jansa
2013-07-06 23:13 ` Martin Jansa [this message]
2013-08-28 8:33 ` [RFC][PATCH 1/4] package.bbclass: move reading shlibs providers to separate function Martin Jansa
2013-09-02 11:19 ` Richard Purdie
2013-09-05 11:40 ` Richard Purdie
2013-09-05 12:01 ` Martin Jansa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1373152387-19393-4-git-send-email-Martin.Jansa@gmail.com \
--to=martin.jansa@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox