Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Portage dependency solving algorithm
Date: Sat, 08 Nov 2014 22:40:39
Message-Id: 545E9BB5.9000402@gentoo.org
In Reply to: Re: [gentoo-dev] Portage dependency solving algorithm by hasufell
1 On 11/08/2014 02:05 PM, hasufell wrote:
2 > On 11/08/2014 10:52 PM, Jauhien Piatlicki wrote:
3 >> 08.11.14 22:47, hasufell написав(ла):
4 >>> On 11/08/2014 10:30 PM, Rich Freeman wrote:
5 >>>> On Sat, Nov 8, 2014 at 2:48 PM, hasufell <hasufell@g.o> wrote:
6 >>>>> On 11/08/2014 08:32 PM, hasufell wrote:
7 >>>>>>> Sorry to chime in like that but if you don't mind, I'd like to ask for a
8 >>>>>>> real-life example for badly declared dependencies with a few words why
9 >>>>>>> those are bad and how to make them actually better?
10 >>>>>>>
11 >>>>>>
12 >>>>>> from dev-haskell/hashtables (note "hashtables" != "hashable"):
13 >>>>>> || ( ( >=dev-haskell/hashable-1.1:=[profile?]
14 >>>>>> <dev-haskell/hashable-1.2:=[profile?] )
15 >>>>>> ( >=dev-haskell/hashable-1.2.1:=[profile?]
16 >>>>>> <dev-haskell/hashable-1.3:=[profile?] )
17 >>>>>> )
18 >>>>>>
19 >>>>>> Latest stable version of dev-haskell/hashable is 1.2.1.0.
20 >>>>>> On a stable system (arch) the paludis dep-solver will try to match the
21 >>>>>> first group first and realize that there is also a stable version
22 >>>>>> 1.1.2.5 that matches that group. At that point there is a correct
23 >>>>>> solution, but since that involves downgrading a package, it will require
24 >>>>>> user-intervention, because it may not be what the user wants.
25 >>>>>> (this is the easy scenario... if downgrading causes blockers, you get
26 >>>>>> much more interesting output)
27 >>>>>>
28 >>>>>
29 >>>>> To be more specific... it is assumed that hashable-1.2.1.0 is already
30 >>>>> installed. Every time the dep solver runs through those packages without
31 >>>>> specifying what you want, you will hit the downgrade-problem.
32 >>>>
33 >>>> I'm missing the problem. The package requires one of two ranges of
34 >>>> hashable versions. One of them is already installed. The dependency
35 >>>> is satisfied.
36 >>>>
37 >>>
38 >>> The one that is installed (1.2.1.0) is *excluded* by the first group,
39 >>> but there is a valid version that fits instead (1.1.2.5).
40 >>>
41 >>> That's the point where the assumptions start about what the depstring
42 >>> means and what the user wants.
43 >>>
44 >>
45 >> So the problem is only with intervals? First of all, maintainer would specify higher interval first here and it would solve a problem with possible downgrading.
46 >
47 > I have a feeling that this is an assumption as well. PMS just says this
48 > is an 'any-of' group. There is not a single word about the processing
49 > order of these specs or which one to prefer, in which case some is
50 > better than the other and so on.
51
52 I think the two obvious algorithms are:
53
54 A) If the user's resolver parameters request maximum upgrades, then the
55 resolver should choose the choice that results the most upgrades.
56
57 B) If the user's resolver parameters request minimum change, then the
58 resolver should choose the choice which results in keeping the most
59 installed packages in place.
60
61 For the dev-haskell/hashtables scenario, the choice on the right wins
62 regardless of whether you're using algorithm A or algorithm B.
63 --
64 Thanks,
65 Zac

Replies

Subject Author
Re: [gentoo-dev] Portage dependency solving algorithm hasufell <hasufell@g.o>