From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] support/graph-depends: detect circular dependencies
Date: Sat, 23 Jan 2016 23:21:21 +0100 [thread overview]
Message-ID: <20160123232121.10d1ffe3@free-electrons.com> (raw)
In-Reply-To: <1453586685-24190-1-git-send-email-yann.morin.1998@free.fr>
Yann,
On Sat, 23 Jan 2016 23:04:45 +0100, Yann E. MORIN wrote:
> Currently, if there is a circular dependency in the packages, the
> graph-depends script just errors out with a Python RunteimError which is
RuntimeError
> We fix that by recusrsing the dependency chain of each package, until we
recursing
> We need to introduce a new function, check_circular_deps(), because we
> can't re-use the existing ones:
>
> - remove_mandatory_deps() does not iterate,
>
> - remove_transitive_deps() does iterate, but we do not call it for the
> top-level package if it is not 'all'
>
> - it does not make sense to use those functions anyway, as they were
> not designed to _check_ but to _at_ on the dependency chain.
at -> act
Isn't kconfig already detecting such situations ? It normally spits out
a warning when you have a circular dep, no ?
> +# This function will check that there is no loop in the dependency chain
> +# As a side effect, it builds up the dependency cache.
> +def check_circular_deps(deps):
> + def recurse(pkg):
> + if not pkg in list(deps.keys()):
> + return
> + chain.append(pkg)
> + for p in deps[pkg]:
> + if p in chain:
> + sys.stderr.write("\nRecursion detected for : %s\n" % (p))
> + while True:
> + _p = chain.pop()
> + sys.stderr.write("which is a dependency of: %s\n" % (_p))
> + if p == _p:
> + sys.exit(1)
> + recurse(p)
> + chain.pop()
> +
> + chain = []
> + for pkg in list(deps.keys()):
> + recurse(pkg)
I am a bit worried about the algorithmic complexity of this new
function. As you know, we had issues with other parts of graph-depends
having a too high algorithmic complexity to handle large
configurations, or configurations having specific patterns of
dependencies.
Have you measured the time impact of this new check on a very large
configuration (like allyespackageconfig) ?
I'm Cc'ing also Gustavo, who has access to a configuration that was
even worse than allyespackageconfig for the previous speed problem
which we fixed.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-01-23 22:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-23 22:04 [Buildroot] [PATCH] support/graph-depends: detect circular dependencies Yann E. MORIN
2016-01-23 22:21 ` Thomas Petazzoni [this message]
2016-01-23 22:31 ` Yann E. MORIN
2016-01-23 23:00 ` Yann E. MORIN
2016-01-24 1:04 ` Arnout Vandecappelle
2016-01-24 11:56 ` Yann E. MORIN
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=20160123232121.10d1ffe3@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.