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: Fri, 24 Mar 2017 10:23:57
Message-Id: 20170324112333.47c918d9@gentoo.org
In Reply to: Re: [gentoo-dev] Re: [PATCH] sys-devel/autoconf: Convert from eblits into an eclass, #586424 by Ciaran McCreesh
1 On Thu, 23 Mar 2017 21:45:41 +0000
2 Ciaran McCreesh <ciaran.mccreesh@××××××××××.com> wrote:
3
4 [...]
5 > > after a few dozens of emails, what i understand of the issue is:
6 > > autoconf assumes either the eblit stuff is in the environment, or
7 > > FILESDIR variable is empty or points to its files dir; this might be
8 > > borderline but definitely not hostile.
9 >
10 > No, the issue is that eblits are a dodgy mechanism that go beyond what
11 > ebuilds are supposed to do and that cause problems for package
12 > manglers. When we're working with a general purpose shell underneath,
13 > it's very hard to write a specification that can preemptively forbid
14 > every kind of perverse mess any developer can come up with,
15 > particularly when the developer starts looking for loopholes like
16 > claiming it's OK to try to access a directory which is defined as
17 > potentially not existing when the clear intent of the specification is
18 > that "the directory isn't guaranteed to be there so don't try to use
19 > it for anything".
20
21 What, exactly, is causing problems then ?
22
23 I'd really like to understand, because so far I've only seen blatant
24 argument-less refusals of anything coming close to eblits based on some
25 subjective code beauty standard. I reiterate: An eblit loading eclass
26 wouldn't access anything in global scope and use FILESDIR the same way
27 things like eapply do, which whatever the spec might say I think is
28 safe to assume is the proper intent.
29
30 As for preemptively forbidding everything, well, that's the same issue
31 as with anything being expressive enough: Best you can do is provide an
32 api and laugh when people shoot themselves in the feet. But you have to
33 maintain said API, or make a new revision of it to change it.
34
35
36 Do we have any (non artificial) implementation that implements this
37 differently ? Either FILESDIR is empty or points to a non-existent
38 directory (binpkgs, no files/ subdir) either it points to the packages
39 files directory consistently. The latter always holds when package has
40 a files/ subdir and before sourcing the ebuild for running any src_*
41 phase. If there is, then we do indeed have an issue, if there is not,
42 then maybe it's more pragmatic to stop adding arbitrary and useless
43 restrictions to the spec.
44
45
46 Also, note that I do consider that pushing patches into portage setting
47 FILESDIR to some location under /var/tmp/portage and playing with
48 symlinks to make it point to something valid or not is also trying to
49 find loopholes in the spec: The spec says the variable is consistent
50 but not what it points to ? For a read-only input ? Really ?
51
52
53 > > this breaks in the (hypothetical?) case where the package is
54 > > installed from a binpkg *and* the binpkg format does not include
55 > > the whole environment but rather a verbatim copy of the ebuild and
56 > > its eclasses(*).
57 > >
58 > > (*) not sure how that can even work with env saving between phases
59 > > but that's not the point
60 >
61 > It can't, so that weird hypothetical is irrelevant. But more to the
62 > point, we're only wondering about these weird hypothetical situations
63 > because someone felt the need to make everyone's life a misery by
64 > putting some special snowflake code in the tree.
65
66 It's a misery only if you look at it :) autoconf is insignificant here,
67 but I'm very happy not having to maintain the libc, I'm very happy the
68 maintainer does it the way that pleases him as long as this does not
69 cause breakages (or when it does it gets fixed, bugs happen), and more
70 importantly I won't force my style nor beauty standards upon him.