On Mon, 20 Mar 2017 15:12:43 +0100
Ulrich Mueller <u...@gentoo.org> wrote:

> >>>>> On Mon, 20 Mar 2017, Alexis Ballier wrote:  
> 
> >> After the PMS change, we will have the same properties for DISTDIR,
> >> FILESDIR, WORKDIR, and S. Namely:
> >> 
> >> - All four variables will be valid in src_* phases and in global
> >> scope
> >> - They will have a consistent value in the ebuild environment
> >> - The actual directories must not be accessed in global scope  
> 
> > Please correct me if I'm wrong, but then portage's behavior of
> > sending empty FILESDIR when it should not be used is wrong after
> > that, right ?  
> 
> No. "Consistent" only means that it has a constant value when it is
> defined, namely in src_* functions and in global scope.

I just tried and with portage 2.3.5, FILESDIR is unset/empty in global
scope here. At least an 'ewarn "${FILESDIR} blah"' outputs only ' blah'.

This case is already accounted for in autoconf, but you seem to want to
change it to having it set to a temptative value that may not exist
for pkg_* phases. Plus aiming at sourcing ebuilds only once (so that
if the eblit sourcing fails once you don't get a second chance). This
is also a desirable goal; I'm not sure if FILESDIR access rules are
sufficient for this to happen but they're definitely necessary.

What makes me wonder more are the proposed solutions: So far the only
proposals I've seen are either inlining *all* the code or moving *all*
the code into an eclass. Having a quick look at autoconf, it seems to me
an intermediate solution would work perfectly fine for the above
goals/rules: Put main.eblit into an eclass. The loading code then would
access $FILESDIR only in src_* phases. This would likely work better
for all parties and would allow to focus on better specifying this gray
area of PMS instead.


> > The idea behind FILESDIR being valid only in src_* phases is to
> > allow portage-tree-less binpkgs to work. Not sure if that's even
> > possible right now, but that is definitely a desirable goal.  
> 
> > If I understand correctly, the change you mention would mean
> > FILESDIR will be "constant". Which is good since that'd avoid
> > regenerating the environment. However, this breaks autoconf ebuild
> > relying on FILESDIR being empty when invalid and this would trigger
> > the 'source $FILESDIR/... || die' part making the ebuild die in
> > global scope.  
> 
> Obviously the FILESDIR variable cannot be empty in global scope if
> PATCHES=("${FILESDIR}"/foo.patch) is supposed to work in EAPI 6.

I'm afraid it sometimes is with current portage versions.

[...]

Alexis.

Reply via email to