Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 652050 - [Future EAPI] Kill S=${WORKDIR} fallback in src_test
Summary: [Future EAPI] Kill S=${WORKDIR} fallback in src_test
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Package Manager Specification
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: future-eapi
  Show dependency tree
 
Reported: 2018-03-30 21:15 UTC by Michał Górny
Modified: 2019-03-09 07:40 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-03-30 21:15:34 UTC
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.
Comment 1 Ulrich Müller gentoo-dev 2018-03-30 21:38:17 UTC
I had inquired about this in 2012 (with no answer):
https://archives.gentoo.org/gentoo-pms/message/0d158aaaffb49594d219c5319adc5f28
Comment 2 Ulrich Müller gentoo-dev 2019-03-04 08:34:21 UTC
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.
Comment 3 Ulrich Müller gentoo-dev 2019-03-04 09:13:49 UTC
> 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.)
Comment 4 Larry the Git Cow gentoo-dev 2019-03-09 07:40:26 UTC
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(-)