1 |
Arguably, section 9.1.1 "Initial working directories" applies also to |
2 |
src_test, even if section 9.1.8 "src_test" doesn't refer back to 9.1.1. |
3 |
|
4 |
In src_test, a fallback from S to WORKDIR could only happen for an |
5 |
ebuild that: |
6 |
- Has no files in A to be unpacked. |
7 |
- Doesn't define any of the unpack, prepare, configure, compile or |
8 |
install phases (otherwise it would die in one of these phases). |
9 |
|
10 |
Since that scenario is very unlikely, fix the wording in section 9.1.8 |
11 |
retroactively for EAPI 4 and later. |
12 |
|
13 |
Note: Implementations also differ about this: portage will always fall |
14 |
back, while for pkgcore it is a conditional error. |
15 |
|
16 |
Closes: https://bugs.gentoo.org/652050 |
17 |
Signed-off-by: Ulrich Müller <ulm@g.o> |
18 |
--- |
19 |
ebuild-functions.tex | 10 ++++++---- |
20 |
1 file changed, 6 insertions(+), 4 deletions(-) |
21 |
|
22 |
diff --git a/ebuild-functions.tex b/ebuild-functions.tex |
23 |
index a4547fa..5c675ab 100644 |
24 |
--- a/ebuild-functions.tex |
25 |
+++ b/ebuild-functions.tex |
26 |
@@ -38,9 +38,9 @@ fallback to \t{WORKDIR} is used: |
27 |
\begin{compactitem} |
28 |
\item The \t{A} variable contains no items. |
29 |
\item The phase function in question is not in \t{DEFINED_PHASES}. |
30 |
-\item None of the phase functions \t{unpack}, \t{prepare}, \t{configure}, \t{compile} or \t{install}, |
31 |
- if supported by the EAPI in question and occurring prior to the phase about to be executed, are |
32 |
- in \t{DEFINED_PHASES}. |
33 |
+\item None of the phase functions \t{unpack}, \t{prepare}, \t{configure}, \t{compile}, \t{test} or |
34 |
+ \t{install}, if supported by the EAPI in question and occurring prior to the phase about to be |
35 |
+ executed, are in \t{DEFINED_PHASES}. |
36 |
\end{compactitem} |
37 |
|
38 |
\ChangeWhenAddingAnEAPI{7} |
39 |
@@ -277,7 +277,9 @@ src_compile() { |
40 |
The \t{src_test} function runs unit tests for the newly built but not yet installed package as |
41 |
provided. |
42 |
|
43 |
-The initial working directory must be \t{S} if that exists, falling back to \t{WORKDIR} otherwise. |
44 |
+The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR} as discussed in |
45 |
+section~\ref{sec:s-to-workdir-fallback}. |
46 |
+ |
47 |
The default implementation used when the ebuild lacks the \t{src_test} function must, if tests are |
48 |
enabled, run \t{emake check} if and only if such a target is available, or if not run |
49 |
\t{emake test} if and only if such a target is available. In both cases, if \t{emake} returns |
50 |
-- |
51 |
2.19.1 |