When S=${WORKDIR} fallback was killed in EAPI 4, src_test() was apparently omitted. Appropriately, both Portage and Paludis still implement the fallback in that phase. Let's kill it completely in a future EAPI, and modify the failure to apply if src_test() exists as well.
I had inquired about this in 2012 (with no answer): https://archives.gentoo.org/gentoo-pms/message/0d158aaaffb49594d219c5319adc5f28
Reading the spec again, section 9.1.1 https://projects.gentoo.org/pms/7/pms.html#x1-860009.1.1 says: "Some functions are described as having an initial working directory of S with an error or fallback to WORKDIR. For EAPIs listed in table 9.1 as having the fallback, this means that if S is not a directory before the start of the phase function, the initial working directory shall be WORKDIR instead. [...]" Arguably this applies also to src_test, even if 9.1.8 doesn't refer back to 9.1.1. Is that fallback in src_test even meaningful? The ebuild would already die in src_{prepare,configure,compile} if S does not point to an existing directory.
> Is that fallback in src_test even meaningful? The ebuild would already die > in src_{prepare,configure,compile} if S does not point to an existing > directory. In other words, the only scenario where the fallback can theoretically occur is 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). I'd suggest that we rectify the wording in section 9.1.8 and fix implementations retroactively. (We could ask in the -dev ML if anyone relies on the current behaviour, but I think it is very unlikely.)
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/pms.git/commit/?id=0038f90a942f0856ae2533b26f709002a3ec80ae commit 0038f90a942f0856ae2533b26f709002a3ec80ae Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2019-03-05 21:53:58 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2019-03-05 21:53:58 +0000 ebuild-functions.tex: S to WORKDIR fallback is conditional for src_test. 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 <ulm@gentoo.org> ebuild-functions.tex | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)