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
On Thu, 21 Jun 2012 20:05:46 +0100
David Leverton <levertond@××××××××××.com> wrote:

> Michał Górny wrote: > > Hello, > > > > A simple solution to a program long-unsolved. In GLEP form. > > Just a couple of minor points/nitpicks: > > 1) If an installed package has both IUSE_RUNTIME and REQUIRED_USE, > should REQUIRED_USE be re-verified: > > a) for every dep resolution > b) when the package is involved in the resolution for some other > reason (not necessarily being reinstalled, just when the resolver has > some reason to look at it) > c) something else? > > I think b) should be sufficient (and probably easier to implement), > but is there any reason why it wouldn't be?
Well, I don't understand the difference between a) and b) in your case but the idea is that REQUIRED_USE should be re-verified if either enabled USE flag list or REQUIRED_USE changes.
> 2) It's not forbidden for package A to depend on an IUSE_RUNTIME flag > of package B being disabled, but it's unlikely to be useful. To make > this more concrete, a fictional but vaguely plausible example: > > app-text/docmangler: > > # links to poppler to handle PDFs, and can use Ghostscript for > # PostScript support if available > IUSE="postscript" > IUSE_RUNTIME="postscript" > DEPEND="app-text/poppler" > RDEPEND="${DEPEND} > postscript? ( app-text/ghostscript )" > > app-misc/coolapp: > > IUSE="doc" > # if Ghostscript is installed, docmangler uses it for both > # PostScript and PDF files, but Ghostscript misrenders our PDFs > DEPEND="doc? ( app-text/docmangler[-postscript] )" > > Here, the [-postscript] dep would force the user to disable that > flag, but it wouldn't do much good because Ghostscript would still be > installed. This doesn't happen with regular USE flags because (if > the ebuild is written correctly) disabling the flag removes the > feature even if its dependencies happen to be installed. > > Possible solutions: > > a) automatically rewrite the dep as > postscript? ( app-text/ghostscript ) > !postscript? ( !app-text/ghostscript ) > b) forbid [-foo]-style deps for IUSE_RUNTIME flags (would also make > sense in that case to disallow them in !foo-style conditionals in the > dependencies of the package itself, as that could cause similar > paradoxes) c) don't address it in the spec itself, and require people > to manually write the dep in the blocker form if it's required > d) something else? > > a) is pretty icky IMHO, especially if the flag pulls in multiple > packages. I could live with either b) or c), but b) is less flexible > and c) leaves a potential trap for the unwary. Any opinions?
Good observation. I think b) is the best solution since forced removal of random dependencies is a very bad idea (and misuse of blockers). -- Best regards, 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>