Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/devmanual:master commit in: general-concepts/dependencies/
Date: Wed, 29 Jan 2020 08:00:00
Message-Id: 1580284707.a7e1e6accfd537734321ddcefcc0515fe64a25e5.ulm@gentoo
1 commit: a7e1e6accfd537734321ddcefcc0515fe64a25e5
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 29 08:47:41 2019 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 29 07:58:27 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=a7e1e6ac
7
8 general-concepts/dependencies: Describe circular deps in detail
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
12
13 general-concepts/dependencies/text.xml | 49 ++++++++++++++++++++++++++++++++++
14 1 file changed, 49 insertions(+)
15
16 diff --git a/general-concepts/dependencies/text.xml b/general-concepts/dependencies/text.xml
17 index dde6cda..2aca289 100644
18 --- a/general-concepts/dependencies/text.xml
19 +++ b/general-concepts/dependencies/text.xml
20 @@ -620,6 +620,55 @@ RESTRICT="!test? ( test )"
21 DEPEND="test? ( dev-util/foo )"
22 </codesample>
23
24 +</body>
25 +</section>
26 +
27 +<section>
28 +<title>Circular Dependencies</title>
29 +<body>
30 +
31 +<p>
32 +Circular dependencies occur if one or more of package's (possibly indirect)
33 +dependencies depend on the package itself. This creates a dependency cycle where
34 +each of the packages must technically be installed before the other.
35 +For example, if package A depends on B, B depends on C and C depends on A, then
36 +the package manager cannot install A before C, and C before A.
37 +</p>
38 +
39 +<p>
40 +There are three kinds of circular dependencies:
41 +</p>
42 +
43 +<ol>
44 + <li>
45 + Circular dependencies that occur if only one of the packages strictly needs
46 + to be installed before the other. For example, <c>dev-python/certifi</c>
47 + strictly requires <c>dev-python/setuptools</c> to build but the latter
48 + package requires the former for some runtime functionality. As a result,
49 + <c>dev-python/certifi</c> can be installed later than the other package.
50 + <c>PDEPEND</c> is used to express this and automatically resolve
51 + the circular dependency.
52 + </li>
53 +
54 + <li>
55 + Circular dependencies that occur if the cycle applies only to some
56 + combination of USE flags on one of the packages. For example, running tests
57 + in <c>dev-python/setuptools</c> requires a number of packages which require
58 + <c>dev-python/setuptools</c> to be installed first. This kind of circular
59 + dependency can be resolved by the user by adjusting USE flags on one
60 + of the packages, e.g. by disabling tests on <c>dev-python/setuptools</c>,
61 + and reenabling them once the dependency is initially installed.
62 + </li>
63 +
64 + <li>
65 + Circular dependencies that cannot be resolved using the regular means.
66 + For example, <c>dev-util/cmake</c> used to depend
67 + on <c>dev-libs/jsoncpp</c>, while the latter package used the former
68 + to build. Resolving this kind of dependency usually requires bundling one
69 + of the dependencies conditionally, or providing an alternate bootstrap path.
70 + </li>
71 +</ol>
72 +
73 </body>
74 </section>
75 </chapter>