Quick start

Dose is an ocaml library designed to analyse large software repositories. The library core does not make any assumption of the semantic and syntax of any specific packages systems and it is based on the Cudf format.

In this tutorial we will work from the ocaml command line.

Create a simple package repository

First we instantiate three cudf packages (p1,p2,p3) and the create a cudf universe containing these three packages.

[[!format Error: unsupported page format ocaml]]

let's now add a dependency from p1 to p2 OR p3

[[!format Error: unsupported page format ocaml]]

and a conflict between p2 and p3. Notice that since conflicts are symmetric, adding a conflict to the package p2 also adds and "implicit" conflict on the package p3.

[[!format Error: unsupported page format ocaml]]

we can now create a universe containing these three packages

[[!format Error: unsupported page format ocaml]]

The cudf document corresponding to this universe

package: p1
version: 1
depends: p2 | p3

package: p2
version: 1
conflicts: p3

package: p3
version: 1

Now that we have a cudf universe we want to check, for example, if a package in this universe is installable, that is all its dependencies can be satisfied in the given universe and the solution does not contain any conflict.

The module Depsolver of dose expose hight level functions to check installability in a given universe. For example :

[[!format Error: unsupported page format ocaml]]

The variable result if of type Algo.Diagnostic.diagnosis. Few help functions exists in the Diagnostic module to analyse this result.

[[!format Error: unsupported page format ocaml]]

We notice that the installation set of the package p1 is composed of package p1 and package p3. Since p1 depends by either p2 or p3, in this instance, the solver arbitrarily choose p3 over p2.

No suppose we want to check if we can install together p2 and p3. The function Depsolver.edos_coinstall allows us to specify a list of packages to be co-installed.

[[!format Error: unsupported page format ocaml]]

Since p2 and p3 are in conflict, this request cannot be satisfied.

[[!format Error: unsupported page format ocaml]]