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.
I think it'd enough to define that they it must be an empty directory or something like that.
(In reply to Michał Górny from comment #1) Yeah, I think that would suffice.
Portage has been updated to change to $HOME when available.
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 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_*'?
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.
(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.