Gentoo Archives: gentoo-dev

From: Michael Orlitzky <mjo@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] Global USE=gui
Date: Tue, 07 Jun 2016 18:50:55
Message-Id: 5757177C.8020400@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] Global USE=gui by "Michał Górny"
1 On 06/07/2016 12:20 PM, Michał Górny wrote:
2 >>
3 >> A pkg_pretend() message would certainly make sense and IMO be a good
4 >> idea, but again this isn't any different than the situation as it
5 >> stands now WITHOUT a USE=gui. Regardless I don't see this as a
6 >> blocker to the idea.
7 >
8 > Nope, it won't. It will only make things slower, more clumsy
9 > and provide no real benefit. pkg_pretend() should be reserved for
10 > checks really needed to build packages and not abused to do some early
11 > output.
12 >
13
14 I forgot to reply to this.
15
16 The benefit of pkg_pretend is that it lets you give a sensible error
17 message. This is not a complex problem we're asking the user to resolve.
18 Here's what the error would say if I used pkg_pretend:
19
20 This package supports two different toolkits, gtk2 and gtk3. Please
21 choose one and add it to your USE flags for <pkg>.
22
23 Here's what it says with REQUIRED_USE:
24
25 !!! Problem resolving dependencies for x11-drivers/nvidia-drivers
26 from @selected
27 ... done!
28
29 !!! The ebuild selected to satisfy "x11-drivers/nvidia-drivers" has
30 unmet requirements.
31 - x11-drivers/nvidia-drivers-352.30::gentoo USE="X multilib tools
32 -acpi -gtk2 -gtk3 -pax_kernel -uvm" ABI_X86="64"
33
34 The following REQUIRED_USE flag constraints are unsatisfied:
35 tools? ( any-of ( gtk2 gtk3 ) )
36
37 The above constraints are a subset of the following complete
38 expression:
39 tools? ( X any-of ( gtk2 gtk3 ) )
40
41 We could make the portage output a little better, but that's going to be
42 an uphill battle and still won't be as informative or short as the
43 pkg_pretend version.
44
45 What we really need is a way to tie an error message to a REQUIRED_USE
46 clause. I think I remember Ciaran sarcastically suggesting that we make
47 REQUIRED_USE a dictionary lookup from clause => message. The sarcasm was
48 probably because all we'd be doing is replacing the if/then/die
49 statements (that we'd use in pkg_pretend) with ?,(), and => in
50 REQUIRED_USE. It's an abstraction without any benefit at that point.

Replies

Subject Author
Re: [gentoo-dev] [RFC] Global USE=gui "Michał Górny" <mgorny@g.o>