1 |
On Sat, Dec 27, 2014 at 8:50 AM, Michał Górny <mgorny@g.o> wrote: |
2 |
> Hello, |
3 |
> |
4 |
> The current design for getting the 'best implementation' is far from |
5 |
> pretty. It pretty much relies on constant preference order, setting |
6 |
> Python 2.7 over other implementations for practical reasons. As a side |
7 |
> effect, various ebuilds rely on that particular order, e.g.: |
8 |
> |
9 |
> DEPEND="doc? ( dev-python/epydoc[$(python_gen_usedep 'python2*')] )" |
10 |
> REQUIRED_USE="doc? ( $(python_gen_useflags 'python2*') )" |
11 |
> |
12 |
> which pretty much assumes that *if python2 is enabled*, then any |
13 |
> version of it will be the best impl. I find this disgusting, and I'd |
14 |
> like to replace it with something more explicit. |
15 |
> |
16 |
|
17 |
Yeah, relying python_compile_all running under python2.7 is no good. |
18 |
|
19 |
> |
20 |
> Specifically: |
21 |
> |
22 |
> 1. python_export_best becomes deprecated for good, |
23 |
> |
24 |
> 2. python_setup changes API to: |
25 |
> |
26 |
> python_setup [<impl-wildcard>...] |
27 |
> |
28 |
> alike python_gen_* functions, defaulting to '*'. Now it chooses |
29 |
> the best impl from implementations matching the specified patterns, |
30 |
> e.g.: |
31 |
> |
32 |
> python_setup 'python2*' |
33 |
> |
34 |
> would get the best version of CPython 2. |
35 |
> |
36 |
> 3. we introduce extra variable for distutils-r1 (oh cruel world, how |
37 |
> should we name it?!) that applies wildcards to python_*_all() phases. |
38 |
> |
39 |
|
40 |
This sounds like a reasonable idea, and a natural extension of the |
41 |
python_setup function. |
42 |
|
43 |
> |
44 |
> As for the choice within the list the algo needs to stay as-is for now. |
45 |
> However, in the future we could either: |
46 |
> |
47 |
> a. respect EPYTHON and fallback to the other algo, |
48 |
> |
49 |
> b. respect pre-defined order i.e. 3.4 > 2.7, |
50 |
> |
51 |
> c. respect the order in PYTHON_COMPAT -- however that could be a little |
52 |
> surprising to devs. |
53 |
> |
54 |
> |
55 |
> What are your thoughts? |
56 |
|
57 |
Starting/ending with EPYTHON from the environment seems wrong, and |
58 |
doesn't seem to add value anyway. |
59 |
|
60 |
I would prefer to stick with a predefined order unless someone can |
61 |
present a case where the ebuild author really needs to control it. |