Gentoo Archives: gentoo-pms

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

Replies