aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2019-12-29 09:47:41 +0100
committerUlrich Müller <ulm@gentoo.org>2020-01-29 08:58:27 +0100
commita7e1e6accfd537734321ddcefcc0515fe64a25e5 (patch)
tree8f8eb2d1d949247760a1d13c4b304c65a91556d7 /general-concepts/dependencies/text.xml
parentgeneral-concepts/dependencies: Improve PDEPEND (diff)
downloaddevmanual-a7e1e6accfd537734321ddcefcc0515fe64a25e5.tar.gz
devmanual-a7e1e6accfd537734321ddcefcc0515fe64a25e5.tar.bz2
devmanual-a7e1e6accfd537734321ddcefcc0515fe64a25e5.zip
general-concepts/dependencies: Describe circular deps in detail
Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'general-concepts/dependencies/text.xml')
-rw-r--r--general-concepts/dependencies/text.xml49
1 files changed, 49 insertions, 0 deletions
diff --git a/general-concepts/dependencies/text.xml b/general-concepts/dependencies/text.xml
index dde6cda..2aca289 100644
--- a/general-concepts/dependencies/text.xml
+++ b/general-concepts/dependencies/text.xml
@@ -622,5 +622,54 @@ DEPEND="test? ( dev-util/foo )"
</body>
</section>
+
+<section>
+<title>Circular Dependencies</title>
+<body>
+
+<p>
+Circular dependencies occur if one or more of package's (possibly indirect)
+dependencies depend on the package itself. This creates a dependency cycle where
+each of the packages must technically be installed before the other.
+For example, if package A depends on B, B depends on C and C depends on A, then
+the package manager cannot install A before C, and C before A.
+</p>
+
+<p>
+There are three kinds of circular dependencies:
+</p>
+
+<ol>
+ <li>
+ Circular dependencies that occur if only one of the packages strictly needs
+ to be installed before the other. For example, <c>dev-python/certifi</c>
+ strictly requires <c>dev-python/setuptools</c> to build but the latter
+ package requires the former for some runtime functionality. As a result,
+ <c>dev-python/certifi</c> can be installed later than the other package.
+ <c>PDEPEND</c> is used to express this and automatically resolve
+ the circular dependency.
+ </li>
+
+ <li>
+ Circular dependencies that occur if the cycle applies only to some
+ combination of USE flags on one of the packages. For example, running tests
+ in <c>dev-python/setuptools</c> requires a number of packages which require
+ <c>dev-python/setuptools</c> to be installed first. This kind of circular
+ dependency can be resolved by the user by adjusting USE flags on one
+ of the packages, e.g. by disabling tests on <c>dev-python/setuptools</c>,
+ and reenabling them once the dependency is initially installed.
+ </li>
+
+ <li>
+ Circular dependencies that cannot be resolved using the regular means.
+ For example, <c>dev-util/cmake</c> used to depend
+ on <c>dev-libs/jsoncpp</c>, while the latter package used the former
+ to build. Resolving this kind of dependency usually requires bundling one
+ of the dependencies conditionally, or providing an alternate bootstrap path.
+ </li>
+</ol>
+
+</body>
+</section>
</chapter>
</guide>