Gentoo Archives: gentoo-commits

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