Gentoo Archives: gentoo-portage-dev

From: Sebastian Luther <SebastianLuther@×××.de>
To: gentoo-portage-dev@l.g.o
Subject: [gentoo-portage-dev] [PATCH 00/10] First steps to get rid of backtracking
Date: Wed, 29 Jan 2014 15:33:31
Message-Id: 1391009594-22750-1-git-send-email-SebastianLuther@gmx.de
1 Hi all,
2
3 as you may have noticed, emerge can in some cases take ages ( >5-10 minutes)
4 to resolve dependencies these days. This happens when lots of backtracking
5 is required to solve slot conflicts and/or to schedule slot operator rebuilds.
6 The problem is that the current backtracking implementation has to rebuild
7 the entire dependency graph from scratch each time it backtracks.
8
9 This series of patches is a first step into fixing this problem.
10
11 What these patches do:
12 Patch 1
13 -------
14 Adds a new data structure called package_tracker. This data structure is
15 meant to replace several of the depgraph data structures.
16 It has some new features not present in the existing data structures.
17 1) It can properly deal with several packages in the same slot.
18 2) It supports removal of previously added packages.
19 3) It tracks package conflicts automatically.
20 4) It has a more general concept of conflicts.
21
22 Not all of the features are used for now, but they will make future
23 changes easier.
24
25 Patch 2-5
26 ---------
27 These patches replace the old data structures with the package tracker
28
29 Patch 6-8
30 ---------
31 These patches fix several issues with emerge output. 6 and 8 are somewhat
32 independent of the other patches in this series. Patch 7 introduces a new
33 function used in Patch 10.
34
35 Patch 9
36 -------
37 New function for patch 10.
38
39 Patch 10
40 --------
41 This patch builds on top of all the previous patches. It introduces two
42 new functions to the depgraph class. A function to remove packages that
43 have previously been pulled in and a function to solve simple slot
44 conflicts without backtracking.
45
46 This should resolve most "no parents that aren't satisfied by other
47 packages in this slot" slot conflicts.
48
49 You may find these patches on github here:
50 https://github.com/few/fews-portage-branch/tree/package_tracker
51
52 Some numbers
53 ------------
54
55 My system has quite a number of conflicts that give emerge a hard time
56 resolving dependencies.
57
58 -uDN world
59
60 Without the patches:
61 * 11 unsolved slot conflicts
62 * 2 unsolved blockers
63 * takes 5 backtracking steps and then fails
64
65 With the patches:
66 * no unsolved slot conflicts or blockers
67 * takes 7 backtracking steps and then succeeds
68
69 In this case it actually became slower, but was finally able to find a solution.
70
71 -e world
72
73 Without the patches:
74 * 5 unsolved slot conflicts
75 * 1 unsolved blocker
76 * takes 23 backtracking steps and then fails
77
78 With the patches:
79 * 1 unsolved slot conflict (From a quick look it looks like there really
80 is no solution.)
81 * takes 13 backtracking steps and then fails
82
83 In this case it's a lot faster, but still unacceptably slow.
84 The result is improved by solving 4 out of 5 conflicts.

Replies