Arguably, section 9.1.1 "Initial working directories" applies also to src_test, even if section 9.1.8 "src_test" doesn't refer back to 9.1.1. In src_test, a fallback from S to WORKDIR could only happen for an ebuild that: - Has no files in A to be unpacked. - Doesn't define any of the unpack, prepare, configure, compile or install phases (otherwise it would die in one of these phases). Since that scenario is very unlikely, fix the wording in section 9.1.8 retroactively for EAPI 4 and later. Note: Implementations also differ about this: portage will always fall back, while for pkgcore it is a conditional error. Closes: https://bugs.gentoo.org/652050 Signed-off-by: Ulrich Müller --- ebuild-functions.tex | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ebuild-functions.tex b/ebuild-functions.tex index a4547fa..5c675ab 100644 --- a/ebuild-functions.tex +++ b/ebuild-functions.tex @@ -38,9 +38,9 @@ fallback to \t{WORKDIR} is used: \begin{compactitem} \item The \t{A} variable contains no items. \item The phase function in question is not in \t{DEFINED_PHASES}. -\item None of the phase functions \t{unpack}, \t{prepare}, \t{configure}, \t{compile} or \t{install}, - if supported by the EAPI in question and occurring prior to the phase about to be executed, are - in \t{DEFINED_PHASES}. +\item None of the phase functions \t{unpack}, \t{prepare}, \t{configure}, \t{compile}, \t{test} or + \t{install}, if supported by the EAPI in question and occurring prior to the phase about to be + executed, are in \t{DEFINED_PHASES}. \end{compactitem} \ChangeWhenAddingAnEAPI{7} @@ -277,7 +277,9 @@ src_compile() { The \t{src_test} function runs unit tests for the newly built but not yet installed package as provided. -The initial working directory must be \t{S} if that exists, falling back to \t{WORKDIR} otherwise. +The initial working directory is \t{S}, with an error or fallback to \t{WORKDIR} as discussed in +section~\ref{sec:s-to-workdir-fallback}. + The default implementation used when the ebuild lacks the \t{src_test} function must, if tests are enabled, run \t{emake check} if and only if such a target is available, or if not run \t{emake test} if and only if such a target is available. In both cases, if \t{emake} returns -- 2.19.1