Gentoo Archives: gentoo-dev

From: Alexis Ballier <aballier@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: [PATCH] sys-devel/autoconf: Convert from eblits into an eclass, #586424
Date: Mon, 20 Mar 2017 17:01:56
Message-Id: 20170320180140.66dbef67@gentoo.org
In Reply to: Re: [gentoo-dev] Re: [PATCH] sys-devel/autoconf: Convert from eblits into an eclass, #586424 by Ulrich Mueller
1 On Mon, 20 Mar 2017 15:12:43 +0100
2 Ulrich Mueller <ulm@g.o> wrote:
3
4 > >>>>> On Mon, 20 Mar 2017, Alexis Ballier wrote:
5 >
6 > >> After the PMS change, we will have the same properties for DISTDIR,
7 > >> FILESDIR, WORKDIR, and S. Namely:
8 > >>
9 > >> - All four variables will be valid in src_* phases and in global
10 > >> scope
11 > >> - They will have a consistent value in the ebuild environment
12 > >> - The actual directories must not be accessed in global scope
13 >
14 > > Please correct me if I'm wrong, but then portage's behavior of
15 > > sending empty FILESDIR when it should not be used is wrong after
16 > > that, right ?
17 >
18 > No. "Consistent" only means that it has a constant value when it is
19 > defined, namely in src_* functions and in global scope.
20
21 I just tried and with portage 2.3.5, FILESDIR is unset/empty in global
22 scope here. At least an 'ewarn "${FILESDIR} blah"' outputs only ' blah'.
23
24 This case is already accounted for in autoconf, but you seem to want to
25 change it to having it set to a temptative value that may not exist
26 for pkg_* phases. Plus aiming at sourcing ebuilds only once (so that
27 if the eblit sourcing fails once you don't get a second chance). This
28 is also a desirable goal; I'm not sure if FILESDIR access rules are
29 sufficient for this to happen but they're definitely necessary.
30
31 What makes me wonder more are the proposed solutions: So far the only
32 proposals I've seen are either inlining *all* the code or moving *all*
33 the code into an eclass. Having a quick look at autoconf, it seems to me
34 an intermediate solution would work perfectly fine for the above
35 goals/rules: Put main.eblit into an eclass. The loading code then would
36 access $FILESDIR only in src_* phases. This would likely work better
37 for all parties and would allow to focus on better specifying this gray
38 area of PMS instead.
39
40
41 > > The idea behind FILESDIR being valid only in src_* phases is to
42 > > allow portage-tree-less binpkgs to work. Not sure if that's even
43 > > possible right now, but that is definitely a desirable goal.
44 >
45 > > If I understand correctly, the change you mention would mean
46 > > FILESDIR will be "constant". Which is good since that'd avoid
47 > > regenerating the environment. However, this breaks autoconf ebuild
48 > > relying on FILESDIR being empty when invalid and this would trigger
49 > > the 'source $FILESDIR/... || die' part making the ebuild die in
50 > > global scope.
51 >
52 > Obviously the FILESDIR variable cannot be empty in global scope if
53 > PATCHES=("${FILESDIR}"/foo.patch) is supposed to work in EAPI 6.
54
55 I'm afraid it sometimes is with current portage versions.
56
57 [...]
58
59 Alexis.

Replies