Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 595030 - [Future EAPI] Formalize initial working directory for all phase functions
Summary: [Future EAPI] Formalize initial working directory for all phase functions
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PMS/EAPI
URL:
Whiteboard: in-eapi-8
Keywords:
Depends on:
Blocks: future-eapi
  Show dependency tree
 
Reported: 2016-09-24 14:57 UTC by Mike Gilbert
Modified: 2021-06-13 20:36 UTC (History)
3 users (show)

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


Attachments
EAPI 8 has empty initial working directories in phase functions (0001-EAPI-8-has-empty-initial-working-directories-in-phas.patch,3.84 KB, patch)
2021-05-23 09:49 UTC, Ulrich Müller
Details | Diff
[v2] EAPI 8 has an empty working directory in pkg_* phases (0001-EAPI-8-has-an-empty-working-directory-in-pkg_-phases.patch,3.69 KB, patch)
2021-05-24 16:01 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Gilbert gentoo-dev 2016-09-24 14:57:13 UTC
PMS currently says this in section 9.1.1:

Some functions may assume that their initial working directory is set to a particular location; these are noted below. If no initial working directory is mandated, it may be set to anything and the ebuild must not rely upon a particular location for it.


I would like to request that we formally define the initial working directory for all phase functions to ensure consistent behavior across package managers. This will reduce the possibility of strange bugs that may be difficult to diagnose.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-09-24 15:15:14 UTC
I think it'd enough to define that they it must be an empty directory or something like that.
Comment 2 Mike Gilbert gentoo-dev 2016-09-24 22:25:43 UTC
(In reply to Michał Górny from comment #1)

Yeah, I think that would suffice.
Comment 3 Mike Gilbert gentoo-dev 2016-10-03 15:27:15 UTC
Portage has been updated to change to $HOME when available.
Comment 4 Ulrich Müller gentoo-dev 2021-05-23 09:49:08 UTC
Created attachment 710517 [details, diff]
EAPI 8 has empty initial working directories in phase functions

Patch for PMS, under the assumption that we would add this to EAPI 8.

Please review.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-05-23 09:59:25 UTC
Comment on attachment 710517 [details, diff]
EAPI 8 has empty initial working directories in phase functions

>diff --git a/eapi-differences.tex b/eapi-differences.tex
>index 6e0c880..6912688 100644
>--- a/eapi-differences.tex
>+++ b/eapi-differences.tex
>@@ -111,6 +111,9 @@ Use dependencies & \compactfeatureref{use-deps} &
> \t{!!}\ blockers & \compactfeatureref{bang-strength} &
>     * & Strong & Strong & Strong & Strong \\
> 
>+Working directory in functions & \compactfeatureref{phase-function-dir} &
>+    Any & Any & Any & Any & Empty \\
>+
> \t{S} to \t{WORKDIR} fallback & \compactfeatureref{s-workdir-fallback} &
>     * & Conditional & Conditional & Conditional & Conditional \\
> 
>@@ -528,6 +531,7 @@ EAPI 8 is EAPI 7 with the following changes:
> \item Bash version is 5.0, \featureref{bash-version}.
> \item Selective fetch/mirror restriction, \featureref{uri-restrict}.
> \item \t{IDEPEND}, \featureref{idepend}.
>+\item Empty default working directory in phase functions, \featureref{phase-function-dir}.
> \item Different \t{src_prepare} implementation, \featureref{src-prepare-8}.
> \item \t{PROPERTIES}, \t{RESTRICT} accumulated across eclasses, \featureref{accumulate-vars}.
> \item \t{useq} banned, \featureref{banned-commands}.

I think this could be misleading, suggesting that it applies to all phase functions.  Maybe explicitly say 'other than src_*'?
Comment 6 Ulrich Müller gentoo-dev 2021-05-24 16:01:34 UTC
Created attachment 711012 [details, diff]
[v2] EAPI 8 has an empty working directory in pkg_* phases

(In reply to Michał Górny from comment #5)
> I think this could be misleading, suggesting that it applies to all phase
> functions.  Maybe explicitly say 'other than src_*'?

Good point. Find v2 attached.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-05-24 17:33:37 UTC
(In reply to Ulrich Müller from comment #6)
> Created attachment 711012 [details, diff] [details, diff]
> [v2] EAPI 8 has an empty working directory in pkg_* phases
> 
> (In reply to Michał Górny from comment #5)
> > I think this could be misleading, suggesting that it applies to all phase
> > functions.  Maybe explicitly say 'other than src_*'?
> 
> Good point. Find v2 attached.

LGTM.