Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9926 - in main/trunk/doc: . dependency_resolution
Date: Fri, 18 Apr 2008 21:30:15
Message-Id: E1Jmy9r-00019Q-To@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-04-18 21:30:10 +0000 (Fri, 18 Apr 2008)
3 New Revision: 9926
4
5 Added:
6 main/trunk/doc/dependency_resolution.docbook
7 main/trunk/doc/dependency_resolution/
8 main/trunk/doc/dependency_resolution/decision_making.docbook
9 main/trunk/doc/dependency_resolution/package_modeling.docbook
10 main/trunk/doc/dependency_resolution/task_scheduling.docbook
11 Modified:
12 main/trunk/doc/portage.docbook
13 Log:
14 Add a new part for "Dependency Resolution".
15
16
17 Added: main/trunk/doc/dependency_resolution/decision_making.docbook
18 ===================================================================
19 --- main/trunk/doc/dependency_resolution/decision_making.docbook (rev 0)
20 +++ main/trunk/doc/dependency_resolution/decision_making.docbook 2008-04-18 21:30:10 UTC (rev 9926)
21 @@ -0,0 +1,65 @@
22 +<chapter id='dependency-resolution-decision-making'>
23 +<title>Decision Making</title>
24 +<sect1 id='dependency-resolution-decision-making-dependency-expression-evaluation'>
25 + <title>Dependency Expression Evaluation</title>
26 + <para>
27 + In terms of boolean logic, a dependency expression can
28 + be expressed in disjunctive normal form (DNF), which is
29 + a disjunction of conjunctive clauses. Each conjunctive clause
30 + represents one possible alternative combination of dependency
31 + atoms capable of satisfying the dependency expression.
32 + </para>
33 +</sect1>
34 +<sect1 id='dependency-resolution-decision-making-look-ahead'>
35 + <title>Look-Ahead</title>
36 + <para>
37 + When there are multiple combinations to choose from,
38 + a look-ahead mechanism will choose an optimal combination
39 + to satisfy constraints and minimize cost. The
40 + following package states influence the cost calculation for
41 + a given combination:
42 + <itemizedlist>
43 + <listitem>
44 + installed
45 + </listitem>
46 + <listitem>
47 + selected (for installation)
48 + </listitem>
49 + <listitem>
50 + not selected (for installation)
51 + </listitem>
52 + </itemizedlist>
53 + </para>
54 + <para>
55 + In cost calculations, virtual packages by themselves are
56 + considered to cost nothing since they do not directly install anything.
57 + It is the dependencies of a virtual package that contribute to it's cost.
58 + </para>
59 + <sect2 id='dependency-resolution-decision-making-look-ahead-constraint-propagation'>
60 + <title>Constraint Propagation</title>
61 + <para>
62 + Combinations that include packages from the "installed" or
63 + "selected" categories are less costly than those that
64 + include packages from the "not selected" category.
65 + When a package is chosen for installation, it transitions to the
66 + "selected" state. This state change propagates
67 + to the cost calculations of later decisions,
68 + influencing later decisions to be consistent with earlier decisions.
69 + This feedback mechanism serves to propagate constraints and can
70 + influence the modeling process to
71 + converge on a more optimal final state.
72 + </para>
73 + </sect2>
74 + <sect2 id='dependency-resolution-decision-making-look-ahead-expanded-search-space'>
75 + <title>Expanded Search Space</title>
76 + <para>
77 + When evaluating virtual atoms, an expanded search space is
78 + considered which recursively traverses
79 + the dependencies of virtual packages
80 + from all slots matching a given virtual atom. All combinations in
81 + this expanded search space are considered when choosing an optimal
82 + combination to satisfy constraints with minimal cost.
83 + </para>
84 + </sect2>
85 +</sect1>
86 +</chapter>
87
88 Added: main/trunk/doc/dependency_resolution/package_modeling.docbook
89 ===================================================================
90 --- main/trunk/doc/dependency_resolution/package_modeling.docbook (rev 0)
91 +++ main/trunk/doc/dependency_resolution/package_modeling.docbook 2008-04-18 21:30:10 UTC (rev 9926)
92 @@ -0,0 +1,93 @@
93 +<chapter id='dependency-resolution-package-modeling'>
94 +<title>Package Modeling</title>
95 +
96 +<sect1 id='dependency-resolution-package-modeling-constraint-satisfaction'>
97 + <title>Constraint Satisfaction</title>
98 + <sect2 id='dedependency-resolution-package-modeling-constraint-satisfaction-constraint-types'>
99 + <title>Constraint Types</title>
100 + <para>
101 + Dependency resolution involves satisfaction of
102 + many constraints:
103 + <itemizedlist>
104 + <listitem>
105 + Persistent configuration parameters, like those that come from
106 + make.profile, make.conf, and the /etc/portage directory.
107 + </listitem>
108 + <listitem>
109 + Current command parameters, which may include options, atoms, or sets.
110 + </listitem>
111 + <listitem>
112 + <link linkend='dependency-resolution-package-modeling-constraint-satisfaction-package-dependencies'>
113 + Package Dependencies</link>
114 + </listitem>
115 + </itemizedlist>
116 + </para>
117 + </sect2>
118 +
119 + <sect2 id='dependency-resolution-package-modeling-constraint-satisfaction-package-dependencies'>
120 + <title>Package Dependencies</title>
121 + <para>
122 + Common types of package dependencies:
123 + <itemizedlist>
124 + <listitem>
125 + Files required for building or installing. Downloads may
126 + be necessary to satisfy these.
127 + </listitem>
128 + <listitem>
129 + Other packages required to be installed for
130 + buildtime or runtime.
131 + </listitem>
132 + <listitem>
133 + Blockers that prevent conflicting packages from being installed
134 + simultaneously.
135 + </listitem>
136 + </itemizedlist>
137 + </para>
138 + </sect2>
139 +</sect1>
140 +
141 +<sect1 id='dependency-resolution-package-modeling-conflicts'>
142 + <title>Conflicts</title>
143 + <sect2 id='dependency-resolution-package-modeling-blocker-conflicts'>
144 + <title>Blocker Conflicts</title>
145 + <para>
146 + If one package blocks another package, the two packages
147 + conflict such that they cannot be installed simultaneously.
148 + These conflicts are often due to file collisions.
149 + </para>
150 + </sect2>
151 + <sect2 id='dependency-resolution-package-modeling-slot-conflicts'>
152 + <title>Slot Conflicts</title>
153 + <para>
154 + If two different packages that occupy the same slot are chosen
155 + to satisfy dependencies, a slot conflict occurs. The two packages
156 + cannot be installed simultaneously and therefore the respective
157 + dependencies will not be satisfied simultaneously.
158 + </para>
159 + </sect2>
160 + <sect2 id='dependency-resolution-package-modeling-indirect-conflicts'>
161 + <title>Indirect Conflicts</title>
162 + <para>
163 + If the dependencies of two parent packages cannot be installed
164 + simultaneously, it creates an indirect conflict between the parent
165 + packages since their respective dependencies cannot be satisfied
166 + simultaneously.
167 + </para>
168 + </sect2>
169 +</sect1>
170 +
171 +<sect1 id='dependency-resolution-package-modeling-dependency-neglection'>
172 + <title>Dependency Neglection</title>
173 + <para>
174 + In order to significantly reduce the resources consumed by
175 + the modeling process, the dependencies of
176 + installed packages may be neglected.
177 + </para>
178 + <para>
179 + If a more complete dependency calculation is desired,
180 + there is a --complete-graph option which will ensure that the
181 + dependencies of installed packages are properly considered.
182 + </para>
183 +</sect1>
184 +
185 +</chapter>
186
187 Added: main/trunk/doc/dependency_resolution/task_scheduling.docbook
188 ===================================================================
189 --- main/trunk/doc/dependency_resolution/task_scheduling.docbook (rev 0)
190 +++ main/trunk/doc/dependency_resolution/task_scheduling.docbook 2008-04-18 21:30:10 UTC (rev 9926)
191 @@ -0,0 +1,36 @@
192 +<chapter id='dependency-resolution-task-scheduling'>
193 +<title>Task Scheduling</title>
194 +<sect1 id='dependency-resolution-task-scheduling-dependencies'>
195 + <title>Task Dependencies</title>
196 + <para>
197 + All tasks are executed in an order such
198 + that a task's dependencies are satisfied
199 + when it is executed. Dependency relationships between tasks
200 + form a directed graph.
201 + </para>
202 +</sect1>
203 +<sect1 id='dependency-resolution-task-scheduling-conflict-avoidance'>
204 + <title>Conflict Avoidance</title>
205 + <para>
206 + In some cases it is possible to adjust package installation order
207 + to avoid having two conflicting packages installed simultaneously.
208 + </para>
209 + <para>
210 + TODO: Automatically uninstall packages when necessary to avoid conflicts.
211 + </para>
212 +</sect1>
213 +<sect1 id='dependency-resolution-task-scheduling-circular-dependencies'>
214 + <title>Circular Dependencies</title>
215 + <para>
216 + TODO: Automatically solve circular dependencies by temporarily disabling
217 + conditional dependencies and then rebuilding packages with the conditional
218 + dependencies enabled.
219 + </para>
220 +</sect1>
221 +<sect1 id='dependency-resolution-task-scheduling-parallel'>
222 + <title>Parallel Scheduling</title>
223 + <para>
224 + TODO: Spawn an appropriate number of tasks in parallel when desired.
225 + </para>
226 +</sect1>
227 +</chapter>
228
229 Added: main/trunk/doc/dependency_resolution.docbook
230 ===================================================================
231 --- main/trunk/doc/dependency_resolution.docbook (rev 0)
232 +++ main/trunk/doc/dependency_resolution.docbook 2008-04-18 21:30:10 UTC (rev 9926)
233 @@ -0,0 +1,6 @@
234 +<part id='dependency-resolution'>
235 +<title>Dependency Resolution</title>
236 +&dependency_resolution_package_modeling;
237 +&dependency_resolution_decision_making;
238 +&dependency_resolution_task_scheduling;
239 +</part>
240
241 Modified: main/trunk/doc/portage.docbook
242 ===================================================================
243 --- main/trunk/doc/portage.docbook 2008-04-18 04:15:07 UTC (rev 9925)
244 +++ main/trunk/doc/portage.docbook 2008-04-18 21:30:10 UTC (rev 9926)
245 @@ -7,6 +7,10 @@
246
247 <!ENTITY project "portage">
248
249 + <!ENTITY dependency_resolution SYSTEM "dependency_resolution.docbook">
250 + <!ENTITY dependency_resolution_package_modeling SYSTEM "dependency_resolution/package_modeling.docbook">
251 + <!ENTITY dependency_resolution_decision_making SYSTEM "dependency_resolution/decision_making.docbook">
252 + <!ENTITY dependency_resolution_task_scheduling SYSTEM "dependency_resolution/task_scheduling.docbook">
253 <!ENTITY package SYSTEM "package.docbook">
254 <!ENTITY package_ebuild SYSTEM "package/ebuild.docbook">
255 <!ENTITY package_ebuild_phases SYSTEM "package/ebuild/phases.docbook">
256 @@ -34,6 +38,7 @@
257 </bookinfo>
258
259 &config;
260 +&dependency_resolution;
261 &package;
262 &qa;
263
264
265 --
266 gentoo-commits@l.g.o mailing list