1 |
On 16/01/2018 08:57, Michał Górny wrote: |
2 |
> W dniu pon, 15.01.2018 o godzinie 16∶27 +0100, użytkownik Francesco |
3 |
> Riosa napisał: |
4 |
>> In late 2015 ${PYTHON_COMPAT_OVERRIDE} has been standardized and added |
5 |
>> to all python eclasses, it's useful for developers that want test and |
6 |
>> mark the package for newer versions of python. |
7 |
>> |
8 |
>> However (unless I'm missing something) PYTHON_COMPAT_OVERRIDE is not |
9 |
>> usable if: |
10 |
>> - the user want only python 2.7 and 3.6 (latest) installed |
11 |
>> no python 3.5 |
12 |
>> - don't want to mess dependencies (the warnings in the eclass are scary) |
13 |
> Because it is not meant to be used for that purpose, and it is not meant |
14 |
> to be used by users at all! It's just a quick hack for developer who |
15 |
> wants to UNLIKELY(check if package works with implementation X) before |
16 |
> he starts the effort on modifying PYTHON_COMPAT in ebuilds. |
17 |
supposed that, but at this point I fail to see the benefit versus the |
18 |
added complexity in the eclasses, however that's not my business. |
19 |
> |
20 |
>> So, what can be done to let the user choose it's preferred python |
21 |
>> version(s) without having to build it's own overlay? |
22 |
>> |
23 |
>> One solution is to change ebuilds in tree to include a user variable in |
24 |
>> the PYTHON* arrays, example: |
25 |
>> |
26 |
>> -PYTHON_COMPAT=( python3_{4,5} ) |
27 |
>> +PYTHON_COMPAT=( python3_{4,5} ${PYTHON_COMPAT_ADD} ) |
28 |
>> |
29 |
>> if someone want to bet that packages are ok with 3.6/latest (even before |
30 |
>> a developer tested it) then add PYTHON_COMPAT_ADD=python3_6 to |
31 |
>> /etc/portage/make.conf and run egencache. |
32 |
>> |
33 |
>> Indeed biggest problem in changing $PYTHON* variables is that metadata |
34 |
>> also change and cache is invalidated. |
35 |
>> |
36 |
>> However if the problem is known (*), and if the change to metadata is |
37 |
>> stable per "system"/"gentoo repo clone", then the solution to the |
38 |
>> problem is easy; just run $(egencache --update -j$(nproc) --repo gentoo) |
39 |
>> after each sync. |
40 |
> This won't work. You are wrongly presuming that egencache regenerates |
41 |
> cache unconditionally. It does so only if either ebuild or eclass |
42 |
> content changed. So it worked for you once because you modified ebuilds |
43 |
> and/or eclasses. It won't work when you change PYTHON_COMPAT_ADD. |
44 |
> |
45 |
> I haven't checked the Portage details but it may see the metadata change |
46 |
> when installing the package. Which means it would install package with |
47 |
> unsatisfied dependencies (because it satisfied dependencies from cache), |
48 |
> then store the final dependencies and TADAAM, you've got broken |
49 |
> depgraph. |
50 |
ouch, that basically kill the proposal, unless portage is modified to |
51 |
check known cache modifying variables, which isn't something I'd like to |
52 |
create. |
53 |
> |
54 |
>> The most important thing is that this solution is scriptable and need no |
55 |
>> human intervention. |
56 |
> So is gpy-upgrade-impl. |
57 |
It seem to do the job, one piece missing is something that monitor |
58 |
gentoo repository to see if it has better version (still w/o wanted |
59 |
python), an inotify for ebuilds. Suggestions? |
60 |
> |
61 |
>> Notice also that it's easy to have an array with duplicate values |
62 |
>> PYTHON_COMPAT=( python3_6 python3_6 ) but at a first glance |
63 |
>> _python_set_impls() is resilient to this. |
64 |
>> |
65 |
>> (*) In a perfect world, where global variables that can change metadata |
66 |
>> are known {egencache,emerge} can be made conscious and warn if the cache |
67 |
>> is invalid, but that's out of scope at the moment. |
68 |
> This isn't perfect world. This is the exact opposite of it, it would be |
69 |
> a mess. Also, conscious tools would probably start plotting against you |
70 |
> if you'd give them such horrible tasks. |
71 |
> |