1 |
On Tue, 7 Jun 2016 14:50:36 -0400 |
2 |
Michael Orlitzky <mjo@g.o> wrote: |
3 |
|
4 |
> On 06/07/2016 12:20 PM, Michał Górny wrote: |
5 |
> >> |
6 |
> >> A pkg_pretend() message would certainly make sense and IMO be a good |
7 |
> >> idea, but again this isn't any different than the situation as it |
8 |
> >> stands now WITHOUT a USE=gui. Regardless I don't see this as a |
9 |
> >> blocker to the idea. |
10 |
> > |
11 |
> > Nope, it won't. It will only make things slower, more clumsy |
12 |
> > and provide no real benefit. pkg_pretend() should be reserved for |
13 |
> > checks really needed to build packages and not abused to do some early |
14 |
> > output. |
15 |
> > |
16 |
> |
17 |
> I forgot to reply to this. |
18 |
> |
19 |
> The benefit of pkg_pretend is that it lets you give a sensible error |
20 |
> message. This is not a complex problem we're asking the user to resolve. |
21 |
> Here's what the error would say if I used pkg_pretend: |
22 |
> |
23 |
> This package supports two different toolkits, gtk2 and gtk3. Please |
24 |
> choose one and add it to your USE flags for <pkg>. |
25 |
> |
26 |
> Here's what it says with REQUIRED_USE: |
27 |
> |
28 |
> !!! Problem resolving dependencies for x11-drivers/nvidia-drivers |
29 |
> from @selected |
30 |
> ... done! |
31 |
> |
32 |
> !!! The ebuild selected to satisfy "x11-drivers/nvidia-drivers" has |
33 |
> unmet requirements. |
34 |
> - x11-drivers/nvidia-drivers-352.30::gentoo USE="X multilib tools |
35 |
> -acpi -gtk2 -gtk3 -pax_kernel -uvm" ABI_X86="64" |
36 |
> |
37 |
> The following REQUIRED_USE flag constraints are unsatisfied: |
38 |
> tools? ( any-of ( gtk2 gtk3 ) ) |
39 |
> |
40 |
> The above constraints are a subset of the following complete |
41 |
> expression: |
42 |
> tools? ( X any-of ( gtk2 gtk3 ) ) |
43 |
> |
44 |
> We could make the portage output a little better, but that's going to be |
45 |
> an uphill battle and still won't be as informative or short as the |
46 |
> pkg_pretend version. |
47 |
> |
48 |
> What we really need is a way to tie an error message to a REQUIRED_USE |
49 |
> clause. I think I remember Ciaran sarcastically suggesting that we make |
50 |
> REQUIRED_USE a dictionary lookup from clause => message. The sarcasm was |
51 |
> probably because all we'd be doing is replacing the if/then/die |
52 |
> statements (that we'd use in pkg_pretend) with ?,(), and => in |
53 |
> REQUIRED_USE. It's an abstraction without any benefit at that point. |
54 |
|
55 |
The point is that: |
56 |
|
57 |
1. REQUIRED_USE is semi-machine-understandable while pkg_pretend() is |
58 |
some random function crap. Portage can be improved to take some |
59 |
sensible action on it. With pkg_pretend, we can't do anything but print. |
60 |
|
61 |
2. REQUIRED_USE can be handled early during dependency resolution. |
62 |
pkg_pretend() is like I want 5 minutes for Portage to calculate |
63 |
the dependencies, then 2 minutes to run pkg_pretend()s, then it tells |
64 |
me I am supposed to change one thing and start over. |
65 |
|
66 |
3. REQUIRED_USE can take USE dependencies into account. pkg_pretend() |
67 |
can't. |
68 |
|
69 |
4. pkg_pretend() is slow, and should be used scarcely. Adding |
70 |
an additional slow step for each package on the list, before starting to |
71 |
build packages is not really helpful. |
72 |
|
73 |
-- |
74 |
Best regards, |
75 |
Michał Górny |
76 |
<http://dev.gentoo.org/~mgorny/> |