Gentoo Archives: gentoo-dev

From: Ralph Sennhauser <sera@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: [PATCH] eutils: Warn on built_with_use usage
Date: Mon, 17 Sep 2012 08:13:44
Message-Id: 20120917101058.25952845@sera-17.lan
In Reply to: Re: [gentoo-dev] Re: [PATCH] eutils: Warn on built_with_use usage by "Gregory M. Turner"
1 On Mon, 17 Sep 2012 00:58:02 -0700
2 "Gregory M. Turner" <gmt@×××××.us> wrote:
3
4 >
5 > > My main focus here is switching built_with_use to actively nagging
6 > > people to stop using it; this includes nagging EAPI0/1 users of it.
7 > > Sans the implementation details, anyone got complaints with the
8 > > intent?
9 >
10 > I have a concern about it, yes. But, maybe there's a good answer to
11 > my concern, so please consider this a friendly ebuild development
12 > question disguised as a complaint :)
13 >
14 > Unless I'm missing something, it seems that once we deprive the
15 > ebuild developer of this feature, there is no simple, supported way
16 > to retrieve the information except to depend on it.
17 >
18 > The issue is that calculating dependencies is not the only reason we
19 > might want to know if a package was built with a particular USE-flag,
20 > and if we get rid of built_with_use, we literally cut ourselves off
21 > from retrieving this information in any officially sanctioned way
22 > (except to DEPEND on it, which may not be semantically correct).
23 >
24 > I can think of all kinds of legitimate reasons we might want to know
25 > if the installed such-and-such package was built with so-and-so
26 > use-flags without depending on it. i.e.:
27 >
28 > o if the current gcc falls within a certain range of version
29 > numbers and was built with graphite, we are going to trigger
30 > a compiler bug. Suppose that there is no graphite support
31 > or dependency in ${P}, and that we can apply a patch which will
32 > work around the bug, but at a performance cost in ${P} we'd rather not
33 > pay unless we have to.
34 >
35 > o We need to modify a Makefile based on how a package we
36 > BDEPEND on was built -- but suppose there is no BDEPEND
37 > /limitation/ to enforce -- in other words, either way, our package
38 > will build, and there is no correlating reverse dependency to
39 > worry about at runtime.
40 >
41 > Such needs are fairly unusual, but they do come up in real life.
42 >
43 > My concern is that this will lead to people doing things like:
44 >
45 > o cut-pasting the old implementation of built_with_use into ebuilds,
46 > -- but that implementation will break if the portage database
47 > layout changes
48 >
49 > o creating bogus one-off use-flags as a way of performing these
50 > queries (and, thanks to the upcoming requirement that USE flags
51 > always appear in IUSE, exposing those flags to the end-user,
52 > perhaps with some confusing description like "whether such-and-such
53 > was built with so-and-so").
54 >
55 > o creating BDEPENDs of -- and sketchy parsers for -- portage-utils
56 > or similar suites, just to ask this question.
57 >
58 > Admittedly, it's hard to prevent people from doing
59 >
60 > built-with-use foo/bar baz || die "${P} needs foo/bar with baz"
61 >
62 > since, once upon a time, that was SOP, and we'd have to parse the
63 > bash code or something to qa warn for it automatically.
64 >
65 > But any number of similar prohibitions are simply documented in the
66 > developer handbook, including this one.
67 >
68 > Am I missing something, here? I kinda think we should go the
69 > opposite direction and un-deprecate the API. It seems like we are
70 > cutting off our nose to spite our face here.
71 >
72 > -gmt
73 >
74
75 has_version foo/bar[baz] can be used in EAPI 2 and later.