Gentoo Archives: gentoo-pms

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-pms@l.g.o
Cc: "Ulrich Müller" <ulm@g.o>
Subject: [gentoo-pms] [PATCH 10/21] EAPI 8 has an empty working directory in pkg_* phases
Date: Thu, 27 May 2021 20:27:46
Message-Id: 20210527202609.6445-11-ulm@gentoo.org
In Reply to: [gentoo-pms] EAPI 8 draft for review by "Ulrich Müller"
1 https://bugs.gentoo.org/595030
2 Signed-off-by: Ulrich Müller <ulm@g.o>
3 ---
4 eapi-differences.tex | 4 ++++
5 ebuild-functions.tex | 26 +++++++++++++++++++++-----
6 2 files changed, 25 insertions(+), 5 deletions(-)
7
8 diff --git a/eapi-differences.tex b/eapi-differences.tex
9 index f3af563..08c4e9f 100644
10 --- a/eapi-differences.tex
11 +++ b/eapi-differences.tex
12 @@ -111,6 +111,9 @@ Use dependencies & \compactfeatureref{use-deps} &
13 \t{!!}\ blockers & \compactfeatureref{bang-strength} &
14 * & Strong & Strong & Strong & Strong \\
15
16 +Working directory in \t{pkg_*} phases & \compactfeatureref{phase-function-dir} &
17 + Any & Any & Any & Any & Empty \\
18 +
19 \t{S} to \t{WORKDIR} fallback & \compactfeatureref{s-workdir-fallback} &
20 * & Conditional & Conditional & Conditional & Conditional \\
21
22 @@ -494,6 +497,7 @@ EAPI 8 is EAPI 7 with the following changes:
23 \item Bash version is 5.0, \featureref{bash-version}.
24 \item Selective fetch/mirror restriction, \featureref{uri-restrict}.
25 \item \t{IDEPEND}, \featureref{idepend}.
26 +\item Empty working directory in \t{pkg_*} phase functions, \featureref{phase-function-dir}.
27 \end{compactitem}
28
29 \ChangeWhenAddingAnEAPI{8}
30 diff --git a/ebuild-functions.tex b/ebuild-functions.tex
31 index ffdea16..00fd259 100644
32 --- a/ebuild-functions.tex
33 +++ b/ebuild-functions.tex
34 @@ -22,11 +22,13 @@ Ebuilds must not call nor assume the existence of any phase functions.
35 \subsection{Initial working directories}
36 \label{sec:s-to-workdir-fallback}
37
38 -Some functions may assume that their initial working directory is set to a particular location;
39 -these are noted below. If no initial working directory is mandated, it may be set to anything and
40 -the ebuild must not rely upon a particular location for it. The ebuild \emph{may} assume that the
41 -initial working directory for any phase is a trusted location that may only be written to by a
42 -privileged user and group.
43 +\featurelabel{phase-function-dir} Some functions may assume that their initial working directory is
44 +set to a particular location; these are noted below. If no initial working directory is mandated,
45 +then for EAPIs listed in table~\ref{tab:function-dirs} as having an empty directory, it must be set
46 +to a dedicated directory that is empty at the start of the function and may be read-only. For other
47 +EAPIs, it may be set to anything. The ebuild must not rely upon a particular location for it.
48 +The ebuild \emph{may} assume that the initial working directory for any phase is a trusted location
49 +that may only be written to by a privileged user and group.
50
51 \featurelabel{s-workdir-fallback} Some functions are described as having an initial working
52 directory of \t{S} with an error or fallback to \t{WORKDIR}\@. For EAPIs listed in
53 @@ -44,6 +46,20 @@ fallback to \t{WORKDIR} is used:
54 executed, are in \t{DEFINED_PHASES}.
55 \end{compactitem}
56
57 +\ChangeWhenAddingAnEAPI{8}
58 +\begin{centertable}{Initial working directory in \t{pkg_*} phase functions for EAPIs}
59 + \label{tab:function-dirs}
60 + \begin{tabular}{ll}
61 + \toprule
62 + \multicolumn{1}{c}{\textbf{EAPI}} &
63 + \multicolumn{1}{c}{\textbf{Initial working directory?}} \\
64 + \midrule
65 + 0, 1, 2, 3, 4, 5, 6, 7 & Any \\
66 + 8 & Empty \\
67 + \bottomrule
68 + \end{tabular}
69 +\end{centertable}
70 +
71 \ChangeWhenAddingAnEAPI{8}
72 \begin{centertable}{EAPIs with \t{S} to \t{WORKDIR} fallbacks}
73 \label{tab:s-fallback-table}
74 --
75 2.31.1