Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: levertond@××××××××××.com
Subject: Re: [gentoo-dev] [pre-GLEP] Optional runtime dependencies via runtime-switchable USE flags
Date: Thu, 21 Jun 2012 19:55:25
Message-Id: 20120621215541.1ef6daa9@pomiocik.lan
In Reply to: Re: [gentoo-dev] [pre-GLEP] Optional runtime dependencies via runtime-switchable USE flags by David Leverton
1 On Thu, 21 Jun 2012 20:05:46 +0100
2 David Leverton <levertond@××××××××××.com> wrote:
3
4 > Michał Górny wrote:
5 > > Hello,
6 > >
7 > > A simple solution to a program long-unsolved. In GLEP form.
8 >
9 > Just a couple of minor points/nitpicks:
10 >
11 > 1) If an installed package has both IUSE_RUNTIME and REQUIRED_USE,
12 > should REQUIRED_USE be re-verified:
13 >
14 > a) for every dep resolution
15 > b) when the package is involved in the resolution for some other
16 > reason (not necessarily being reinstalled, just when the resolver has
17 > some reason to look at it)
18 > c) something else?
19 >
20 > I think b) should be sufficient (and probably easier to implement),
21 > but is there any reason why it wouldn't be?
22
23 Well, I don't understand the difference between a) and b) in your case
24 but the idea is that REQUIRED_USE should be re-verified if either
25 enabled USE flag list or REQUIRED_USE changes.
26
27 > 2) It's not forbidden for package A to depend on an IUSE_RUNTIME flag
28 > of package B being disabled, but it's unlikely to be useful. To make
29 > this more concrete, a fictional but vaguely plausible example:
30 >
31 > app-text/docmangler:
32 >
33 > # links to poppler to handle PDFs, and can use Ghostscript for
34 > # PostScript support if available
35 > IUSE="postscript"
36 > IUSE_RUNTIME="postscript"
37 > DEPEND="app-text/poppler"
38 > RDEPEND="${DEPEND}
39 > postscript? ( app-text/ghostscript )"
40 >
41 > app-misc/coolapp:
42 >
43 > IUSE="doc"
44 > # if Ghostscript is installed, docmangler uses it for both
45 > # PostScript and PDF files, but Ghostscript misrenders our PDFs
46 > DEPEND="doc? ( app-text/docmangler[-postscript] )"
47 >
48 > Here, the [-postscript] dep would force the user to disable that
49 > flag, but it wouldn't do much good because Ghostscript would still be
50 > installed. This doesn't happen with regular USE flags because (if
51 > the ebuild is written correctly) disabling the flag removes the
52 > feature even if its dependencies happen to be installed.
53 >
54 > Possible solutions:
55 >
56 > a) automatically rewrite the dep as
57 > postscript? ( app-text/ghostscript )
58 > !postscript? ( !app-text/ghostscript )
59 > b) forbid [-foo]-style deps for IUSE_RUNTIME flags (would also make
60 > sense in that case to disallow them in !foo-style conditionals in the
61 > dependencies of the package itself, as that could cause similar
62 > paradoxes) c) don't address it in the spec itself, and require people
63 > to manually write the dep in the blocker form if it's required
64 > d) something else?
65 >
66 > a) is pretty icky IMHO, especially if the flag pulls in multiple
67 > packages. I could live with either b) or c), but b) is less flexible
68 > and c) leaves a potential trap for the unwary. Any opinions?
69
70 Good observation. I think b) is the best solution since forced removal
71 of random dependencies is a very bad idea (and misuse of blockers).
72
73 --
74 Best regards,
75 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] [pre-GLEP] Optional runtime dependencies via runtime-switchable USE flags David Leverton <levertond@××××××××××.com>