Up

module OpamCudf

: sig

Cudf interface

#
module Set : OpamMisc.SET with type elt = Cudf.package

Cudf sets

#
module Map : OpamMisc.MAP with type key = Cudf.package

Cudf maps

#
module Graph : sig

Cudf graph

#
type t

Graph of cudf packages

#
val of_universe : Cudf.universe -> t

Build a graph from a CUDF universe

#
val transitive_closure : t -> t

Return the transitive closure of g

#
val close_and_linearize : t -> Set.t -> Cudf.package list

Return the transitive closure of dependencies of set, sorted in topological order.

end
#
module Diff : sig

Difference between universes

#
type package = {
# installed
: Set.t;
# removed
: Set.t;
# reinstalled
: Set.t;
}

Differences between the versions of a given package

#
type universe = (Cudf_types.pkgname, package) Hashtbl.t

Difference between universe

#
val diff : Cudf.universe -> Cudf.universe -> universe

Computation of differences between universe

end
#
module ActionGraph : OpamParallel.GRAPH with type V.t = Cudf.package OpamTypes.action

Cudf action graph

#
type conflict

Abstract type that may be returned in case of conflicts

#
val dependencies : Cudf.universe -> Cudf.package list -> Cudf.package list

Return the transitive closure of dependencies of set, sorted in topological order

#
val reverse_dependencies : Cudf.universe -> Cudf.package list -> Cudf.package list

Return the transitive closure of dependencies of set, sorted in topological order

#
val check_request : ?explain:bool -> version_map:int OpamPackage.Map.t -> Cudf.universe -> Cudf_types.vpkg OpamTypes.request -> (Cudf.universe, conflict) OpamTypes.result

Check if a request is satisfiable and return the reasons why not unless explain is set to false

#
val get_final_universe : version_map:int OpamPackage.Map.t -> Cudf.universe -> Cudf_types.vpkg OpamTypes.request -> (Cudf.universe, conflict) OpamTypes.result

Compute the final universe state using the external solver.

#
val actions_of_diff : Diff.universe -> Cudf.package OpamTypes.action list

Compute the list of actions to match the difference between two universe. Remark: the result order is unspecified, ie. need to use solution_of_actions to get a solution which respects the topological order induced by dependencies.

#
exception Cyclic_actions of Cudf.package OpamTypes.action list list
#
val solution_of_actions : simple_universe:Cudf.universe -> complete_universe:Cudf.universe -> requested:OpamPackage.Name.Set.t -> Cudf.package OpamTypes.action list -> solution

Computes the actions to process from a solution, from the actions obtained by a simple universe diff. The 'simple' universe should not contain build dependencies and will be used for resolution ; complete_universe should include build-deps, it's used for ordering of actions and, together with the requested set of package names, for computing the reasons of the actions.

May raise Cyclic_actions.

#
val resolve : extern:bool -> version_map:int OpamPackage.Map.t -> Cudf.universe -> Cudf_types.vpkg OpamTypes.request -> (Cudf.universe, conflict) OpamTypes.result

Resolve a CUDF request. The result is either a conflict holding an explanation of the error, or a resulting universe. ~extern specifies whether the external solver should be used

#
val to_actions : (Cudf.universe -> Cudf.universe) -> Cudf.universe -> (Cudf.universe, conflict) OpamTypes.result -> (Cudf.package OpamTypes.action list, conflict) OpamTypes.result

Computes a list of actions to proceed from the result of resolve. Note however than the action list is not yet complete: the transitive closure of reinstallations is not yet completed, as it requires to fold over the dependency graph in considering the optional dependencies. The first argument specifies a function that will be applied to the starting universe before computation: useful to re-add orphan packages.

#
val remove : Cudf.universe -> Cudf_types.pkgname -> Cudf_types.constr -> Cudf.universe

remove universe name constr Remove all the packages called name satisfying the constraints constr in the universe universe.

#
val uninstall_all : Cudf.universe -> Cudf.universe

Uninstall all the package in the universe.

#
val install : Cudf.universe -> Cudf.package -> Cudf.universe

Install a package in the universe. We don't care about any invariant here (eg. the resulting universe can have mutliple versions of the same package installed).

#
val remove_all_uninstalled_versions_but : Cudf.universe -> string -> Cudf_types.constr -> Cudf.universe

Remove all the versions of a given package, but the one given as argument.

#
val s_source : string

Cudf labels for package fields in the cudf format (use for the field Cudf.pkg_extra and with Cudf.lookup_package_property)

the original OPAM package name (as string)

#
val s_source_number : string

the original OPAM package version (as string)

#
val s_reinstall : string

a package to be reinstalled (a bool)

#
val s_installed_root : string

true if this package belongs to the roots ("installed manually") packages

#
val s_pinned : string

true if the package is pinned to this version

Pretty-printing

#
val string_of_vpkgs : Cudf_types.vpkg list -> string

Convert a package constraint to something readable.

#
val make_conflicts : Cudf.universe -> Algo.Diagnostic.diagnosis -> ('a, conflict) OpamTypes.result
#
val cycle_conflict : Cudf.universe -> string list list -> ('a, conflict) OpamTypes.result
#
val string_of_conflict : (OpamTypes.atom -> string) -> conflict -> string

Convert a conflict to something readable by the user. The first argument should return a string like "lwt<3.2.1 is not available because..." when called on an unavailable package (the reason can't be known this deep in the solver)

#
val strings_of_conflict : (OpamTypes.atom -> string) -> conflict -> string list * string list * string list

Returns three lists of strings:

  • the final reasons why the request can't be satisfied
  • the dependency chains explaining it
  • the cycles in the actions to process (exclusive with the other two)
#
val dump_universe : Pervasives.out_channel -> Cudf.universe -> unit

Dumps the given cudf universe to the given channel

#
val string_of_atom : Cudf_types.vpkg -> string

Pretty-print atoms

#
val string_of_request : Cudf_types.vpkg OpamTypes.request -> string

Pretty-print requests

#
val string_of_universe : Cudf.universe -> string

Pretty-print the universe

#
val string_of_packages : Cudf.package list -> string

Pretty-print of packages

#
val cudf2opam : Cudf.package -> OpamTypes.package

Convert a cudf package back to an OPAM package

#
val packages : Cudf.universe -> Cudf.package list

Returns the list of packages in a Cudf universe

#
val external_solver_available : unit -> bool

External solver

#
val check_cudf_version : unit -> [
| `Compat
| `Latest
]

Runs a test to check the version of the optimisation criteria accepted by the external solver. Result is cached for subsequent queries.

#
val to_cudf : Cudf.universe -> Cudf_types.vpkg OpamTypes.request -> Cudf.preamble * Cudf.universe * Cudf.request

Converts an OPAM request to a Cudf request

end