1 |
On Sun, 4 Jun 2017 10:59:38 +0200 |
2 |
Alexis Ballier <aballier@g.o> wrote: |
3 |
|
4 |
> Here's a quick n dirty code to play with, based on yours: |
5 |
> https://github.com/aballier/required-use |
6 |
|
7 |
I've run that on the whole tree (considering all ebuilds with non |
8 |
empty REQUIRED_USE), some stats: |
9 |
|
10 |
$ time python3 classify.py requsel |
11 |
Stats: |
12 |
Parse error: 16 |
13 |
Good: 8316 |
14 |
Need topo sort: 140 |
15 |
Cyclic: 57 |
16 |
|
17 |
real 0m2.996s |
18 |
user 0m2.950s |
19 |
sys 0m0.004s |
20 |
|
21 |
|
22 |
Running time is good I think. |
23 |
Parse error is some nested construct not supported by your parser that |
24 |
I have not fixed either. |
25 |
|
26 |
|
27 |
~2.5% simply need to be reordered. ~0.6% require more clever thinking. |
28 |
|
29 |
|
30 |
Let's have a look at a few of them: |
31 |
|
32 |
sys-fs/cryptsetup-1.7.5 |
33 |
^^ ( gcrypt kernel nettle openssl ) python? ( || |
34 |
( python_targets_python2_7 python_targets_python3_4 |
35 |
python_targets_python3_5 python_targets_python3_6 ) ) |
36 |
static? ( !gcrypt ) |
37 |
|
38 |
USE='-* static' is painful: the first ^^ will enable gcrypt, static? |
39 |
( !gcrypt ) will disable it. Reordering the ^^ so that kernel appears |
40 |
first fixes the cycle. |
41 |
|
42 |
|
43 |
media-libs/mesa-13.0.6 |
44 |
|| ( gcrypt libressl nettle openssl ) d3d9? |
45 |
( dri3 gallium ) llvm? ( gallium ) opencl? ( gallium llvm ) openmax? |
46 |
( gallium ) gles1? ( egl ) gles2? ( egl ) vaapi? ( gallium ) vdpau? |
47 |
( gallium ) vulkan? ( video_cards_i965 ) wayland? ( egl gbm ) xa? |
48 |
( gallium ) video_cards_freedreno? ( gallium ) video_cards_intel? |
49 |
( classic ) video_cards_i915? ( || ( classic gallium ) ) |
50 |
video_cards_i965? ( classic ) video_cards_nouveau? ( || ( classic |
51 |
gallium ) ) video_cards_radeon? ( || ( classic gallium ) gallium? |
52 |
( x86? ( llvm ) amd64? ( llvm ) ) ) video_cards_r100? ( classic ) |
53 |
video_cards_r200? ( classic ) video_cards_r300? ( gallium x86? ( llvm ) |
54 |
amd64? ( llvm ) ) video_cards_r600? ( gallium ) video_cards_radeonsi? |
55 |
( gallium llvm ) video_cards_vmware? ( gallium ) |
56 |
|
57 |
The cycle is mostly due to: |
58 |
$ python3 nsolve.py 'llvm? ( gallium ) gallium? ( llvm )' |
59 |
[...] |
60 |
toposort.CircularDependencyError: Circular dependencies exist among |
61 |
these items: {[gallium]? => [llvm]:{[llvm]? => [gallium]}, [llvm]? => |
62 |
[gallium]:{[gallium]? => [llvm]}} |
63 |
|
64 |
|
65 |
This is something I had overseen when replacing 'a q'_j is some p_i and |
66 |
one of q_1 ... q_m might be false' by only 'a q'_j is some p_i'; it can |
67 |
be replaced without changing anything in the way PM would solve it by |
68 |
"a q'_j is some p_i and the set of {q_j} is not a subset of q' union |
69 |
p'" (that is, {q_i} is not trivially true if the 2nd clause is |
70 |
applied). Extending that, we get those stats: |
71 |
|
72 |
Stats: |
73 |
Parse error: 16 |
74 |
Good: 8325 |
75 |
Need topo sort: 146 |
76 |
Cyclic: 42 |
77 |
|
78 |
real 0m1.575s |
79 |
user 0m1.563s |
80 |
sys 0m0.012s |
81 |
|
82 |
|
83 |
Now we seem to get only valid warnings (I have not checked them all |
84 |
though): |
85 |
|
86 |
sys-firmware/seabios-1.10.1: |
87 |
debug? ( !binary ) !amd64? ( !x86? ( binary ) ) |
88 |
|
89 |
USE="debug -amd64 -x86" ? |
90 |
|
91 |
|
92 |
sci-libs/ceres-solver-1.11.0: |
93 |
test? ( gflags ) sparse? ( lapack ) abi_x86_32? ( !sparse !lapack ) |
94 |
|
95 |
USE='-* sparse -lapack abi_x86_32' shows a conflict between the last 2 |
96 |
clauses. Better write: |
97 |
|
98 |
test? ( gflags ) !abi_x86_32? ( sparse? ( lapack ) ) abi_x86_32? |
99 |
( !sparse !lapack ) |
100 |
|
101 |
which makes the test work |
102 |
|
103 |
|
104 |
|
105 |
mail-mta/exim-4.89 |
106 |
dane? ( !gnutls ) dmarc? ( spf dkim ) pkcs11? ( gnutls ) spf? |
107 |
( exiscan-acl ) srs? ( exiscan-acl ) |
108 |
|
109 |
USE="dane pkcs11" ? |
110 |
|
111 |
sci-libs/hdf5-1.8.18: |
112 |
threads? ( !cxx !mpi !fortran !hl ) fortran2003? ( fortran ) |
113 |
|
114 |
USE="threads fortran2003" ? |
115 |
|
116 |
|
117 |
|
118 |
|
119 |
|
120 |
I'll let you play with it, but for me it seems this would work quite |
121 |
nicely. |
122 |
|
123 |
|
124 |
Alexis. |