Gentoo Archives: gentoo-commits

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms:master commit in: /
Date: Sun, 28 Oct 2018 18:12:06
Message-Id: 1540750104.ab9099c3e51badb8fe81dc8b37b7f41ee74257fb.ulm@gentoo
1 commit: ab9099c3e51badb8fe81dc8b37b7f41ee74257fb
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 4 17:13:37 2018 +0000
4 Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 28 18:08:24 2018 +0000
6 URL: https://gitweb.gentoo.org/proj/pms.git/commit/?id=ab9099c3
7
8 dependencies: Permit {,B}DEPEND in source-initiated pkg_setup
9
10 Account for build dependencies being satisfied in pkg_setup, when
11 executed as part of source build, in order to match the realistic
12 implementation and widespread use in Gentoo. This changes pkg_setup
13 from the previous state of no dependencies being guaranteed.
14
15 Firstly, this matches the standard package manager implementation
16 better. Since pkg_setup is executed as part of the sequence of
17 successive phases comprising a source build, it is natural that build
18 dependencies are installed already when it's executed, and not between
19 pkg_setup and src_unpack.
20
21 Secondly, it accounts for widespread use of pkg_setup to determine
22 installed dependencies in order to set the build environment
23 appropriately. This is a case e.g. with python-any-r1 or llvm eclasses,
24 which query installed packages in order to determine the Python or LLVM
25 version to use, appropriately. This behavior can't be changed without
26 major changes to a large number of ebuilds, and without making ebuild
27 development harder.
28
29 Technically, we could extend the same rule to RDEPEND being satisfied
30 when package is going to be installed. However, this would restrict
31 the flexibility of parallel builds. With regard to the current rules,
32 the package manager can start building package from sources before all
33 of its runtime dependencies are installed. The unclear benefit
34 of having RDEPEND satisfied in pkg_setup does not seem to justify losing
35 this possibility.
36
37 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
38 Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
39
40 dependencies.tex | 12 ++++++++----
41 1 file changed, 8 insertions(+), 4 deletions(-)
42
43 diff --git a/dependencies.tex b/dependencies.tex
44 index deb5d9c..9675d9e 100644
45 --- a/dependencies.tex
46 +++ b/dependencies.tex
47 @@ -11,9 +11,12 @@
48 \multicolumn{1}{c}{\textbf{Phase function}} &
49 \multicolumn{1}{c}{\textbf{Satisfied dependency classes}} \\
50 \midrule
51 - \t{pkg_pretend}, \t{pkg_setup}, \t{pkg_info}, \t{pkg_nofetch} &
52 + \t{pkg_pretend}, \t{pkg_info}, \t{pkg_nofetch} &
53 None (ebuilds can rely only on the packages in the system~set) \\
54 \addlinespace
55 + \t{pkg_setup} & Same as \t{src_unpack} if executed as part of source build,
56 + same as \t{pkg_pretend} otherwise \\
57 + \addlinespace
58 \t{src_unpack}, \t{src_prepare}, \t{src_configure}, \t{src_compile}, \t{src_test},
59 \t{src_install} & \t{DEPEND}, \t{BDEPEND} \\
60 \addlinespace
61 @@ -44,9 +47,10 @@
62 There are three classes of dependencies supported by ebuilds:
63
64 \begin{compactitem}
65 -\item Build dependencies (\t{DEPEND}). These must be installed and usable before any of
66 - the ebuild \t{src_*} phase functions is executed. These may not be installed at all
67 - if a binary package is being merged.
68 +\item Build dependencies (\t{DEPEND}). These must be installed and usable before the \t{pkg_setup}
69 + phase function is executed as a part of source build and throughout all \t{src_*} phase
70 + functions executed as part of that build. These may not be installed at all if a binary package
71 + is being merged.
72 \item Runtime dependencies (\t{RDEPEND}). These must be installed and usable before
73 the results of an ebuild merging are treated as usable.
74 \item Post dependencies (\t{PDEPEND}). These must be installed at some point before