Gentoo Archives: gentoo-dev

From: Rich Freeman <rich0@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Portage dependency solving algorithm
Date: Sat, 08 Nov 2014 21:30:11
Message-Id: CAGfcS_m7UXyM1RUzpTjHkOz5n68woZ=9bseESPxuJUv57ctppQ@mail.gmail.com
In Reply to: Re: [gentoo-dev] Portage dependency solving algorithm by hasufell
1 On Sat, Nov 8, 2014 at 2:48 PM, hasufell <hasufell@g.o> wrote:
2 > On 11/08/2014 08:32 PM, hasufell wrote:
3 >> On 11/08/2014 08:01 PM, Matthias Dahl wrote:
4 >>> Hello Ciaran...
5 >>>
6 >>> On 08/11/14 19:26, Ciaran McCreesh wrote:
7 >>>
8 >>>> No. It would make sense to introduce a cultural change, where
9 >>>> developers stop writing dependencies that seem to work with some
10 >>>> particular version of Portage if you don't look very closely, and start
11 >>>> writing good dependencies.
12 >>>
13 >>> Sorry to chime in like that but if you don't mind, I'd like to ask for a
14 >>> real-life example for badly declared dependencies with a few words why
15 >>> those are bad and how to make them actually better?
16 >>>
17 >>
18 >> from dev-haskell/hashtables (note "hashtables" != "hashable"):
19 >> || ( ( >=dev-haskell/hashable-1.1:=[profile?]
20 >> <dev-haskell/hashable-1.2:=[profile?] )
21 >> ( >=dev-haskell/hashable-1.2.1:=[profile?]
22 >> <dev-haskell/hashable-1.3:=[profile?] )
23 >> )
24 >>
25 >> Latest stable version of dev-haskell/hashable is 1.2.1.0.
26 >> On a stable system (arch) the paludis dep-solver will try to match the
27 >> first group first and realize that there is also a stable version
28 >> 1.1.2.5 that matches that group. At that point there is a correct
29 >> solution, but since that involves downgrading a package, it will require
30 >> user-intervention, because it may not be what the user wants.
31 >> (this is the easy scenario... if downgrading causes blockers, you get
32 >> much more interesting output)
33 >>
34 >
35 > To be more specific... it is assumed that hashable-1.2.1.0 is already
36 > installed. Every time the dep solver runs through those packages without
37 > specifying what you want, you will hit the downgrade-problem.
38
39 I'm missing the problem. The package requires one of two ranges of
40 hashable versions. One of them is already installed. The dependency
41 is satisfied.
42
43 If the user cared which version they had installed they should have to
44 specify this. Otherwise the package manager should just assume that
45 the user doesn't care whether hashable is installed or not - they just
46 want hashtables installed (or more likely they want something which
47 needs hashtables installed).
48
49 I get that we order || dependencies to hint to the package manager
50 which dep should be preferred if there is no reason to favor one over
51 the other. It shouldn't mean that if you have the second dep
52 installed that it should try to switch to the first if there are no
53 conflicts.
54
55 In any case, I'm curious as to how you would propose improving such a
56 dependency? I definitely see how the syntax could be cleaned up so
57 that I don't have to poke my eyeballs out, but I don't see what it
58 would accomplish in terms of dependency resolution (maybe if there was
59 more use of (sub)slotting and a syntax based on that it might allow
60 for a different way of searching the dependencies and cut out a few
61 checks, but I'd have to think about that).
62
63 --
64 Rich

Replies

Subject Author
Re: [gentoo-dev] Portage dependency solving algorithm hasufell <hasufell@g.o>
Re: [gentoo-dev] Portage dependency solving algorithm Ciaran McCreesh <ciaran.mccreesh@××××××××××.com>