OpamCudfSolver interaction through Cudf, conversion of solver answer to an opam solution
module Package : sig ... endmodule Set : OpamStd.SET with type elt = Package.tCudf sets
module Map : OpamStd.MAP with type key = Package.tCudf maps
module Graph : sig ... endCudf graph
val diff : Cudf.universe -> Cudf.universe -> Set.t * Set.tComputation of differences between universe. Returns the sets of packages to install and remove respectively.
module Action : OpamActionGraph.ACTION with type package = Package.tCudf action graph
module ActionGraph : OpamActionGraph.SIG with type package = Package.tval dependency_sort : Cudf.universe -> Set.t -> Cudf.package listSorts the given packages topolgically (be careful if there are cycles, e.g. if the universe was loaded with post dependencies enabled)
val trim_universe : Cudf.universe -> Set.t -> Cudf.universePre-process a universe to remove incompatible/unneeded packages and ease the task of the solvers
val check_request :
?explain:bool ->
version_map:int OpamPackage.Map.t ->
Cudf.universe ->
Cudf_types.vpkg OpamTypes.request ->
(Cudf.universe, conflict) OpamTypes.resultCheck 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.resultCompute the final universe state using the external solver.
val actions_of_diff :
(Set.t * Set.t) ->
Cudf.package OpamTypes.atomic_action listCompute the list of actions to match the difference between two universe. Remark: the result order is unspecified, ie. need to use atomic_actions to get a solution which respects the topological order induced by dependencies.
exception Cyclic_actions of Cudf.package OpamTypes.action list listval atomic_actions :
simple_universe:Cudf.universe ->
complete_universe:Cudf.universe ->
[< Cudf.package OpamTypes.highlevel_action ] list ->
ActionGraph.tComputes 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 to get the dependency ordering of actions.
Returns a graph of atomic actions, i.e. only removals and installs. Use reduce_actions to reduce it to a graph including reinstall and up/down-grade actions.
val trim_actions :
Cudf.universe ->
OpamPackage.Name.Set.t ->
ActionGraph.t ->
unitRemoves from a graph of actions the disjoint subgraphs that don't concern requested packages. The provided universe should *include* post-dependencies so that they don't get trimmed away. Note: if the specified requested set is empty, all actions are supposed to be meaningful.
val compute_root_causes :
ActionGraph.t ->
OpamPackage.Name.Set.t ->
OpamPackage.Set.t ->
OpamPackage.Set.t ->
Cudf.package OpamTypes.cause Map.tHeuristic to compute the likely cause of all actions in a graph from the set of packages passed in the original request. Assumes a reduced graph. Takes the set of requested package names, the set of packages marked for reinstall, and the set of all available packages.
val resolve :
extern:bool ->
version_map:int OpamPackage.Map.t ->
Cudf.universe ->
Cudf_types.vpkg OpamTypes.request ->
(Cudf.universe, conflict) OpamTypes.resultResolve 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, conflict) OpamTypes.result ->
(Cudf.package OpamTypes.atomic_action list, conflict) OpamTypes.resultComputes 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.
val remove :
Cudf.universe ->
Cudf_types.pkgname ->
Cudf_types.constr ->
Cudf.universeremove universe name constr Remove all the packages called name satisfying the constraints constr in the universe universe.
val uninstall_all : Cudf.universe -> Cudf.universeUninstall all the package in the universe.
val install : Cudf.universe -> Cudf.package -> Cudf.universeInstall a package in the universe. We don't care about any invariant here (eg. the resulting universe can have multiple versions of the same package installed).
val remove_all_uninstalled_versions_but :
Cudf.universe ->
string ->
Cudf_types.constr ->
Cudf.universeRemove all the versions of a given package, but the one given as argument.
Cudf labels for package fields in the cudf format (use for the field Cudf.pkg_extra and with Cudf.lookup_package_property)
true if this package belongs to the roots ("installed manually") packages
valid cudf name for the dummy package used for enforcing opam's switch invariants
valid cudf name and version for the dummy package used for enforcing opam's switch invariants
val is_opam_invariant : Cudf.package -> booldummy package that shouldn't exist and encodes unavailability (by depending on it)
val string_of_vpkgs : Cudf_types.vpkg list -> stringConvert a package constraint to something readable.
val make_conflicts :
version_map:int OpamTypes.package_map ->
Cudf.universe ->
Dose_algo.Diagnostic.diagnosis ->
('a, conflict) OpamTypes.resultval cycle_conflict :
version_map:int OpamTypes.package_map ->
Cudf.universe ->
Cudf.package OpamTypes.action list list ->
('a, conflict) OpamTypes.resulttype explanation = [ | `Conflict of string option * string list * bool| `Missing of string option * string * OpamFormula.t ]val string_of_conflicts :
OpamTypes.package_set ->
((OpamTypes.name * OpamFormula.version_formula) -> string) ->
conflict ->
stringConvert a conflict to something readable by the user. The second argument should return a string explaining the unavailability, or the empty string, when called on an unavailable package (the reason can't be known this deep in the solver)
val string_of_explanations :
((OpamTypes.name * OpamFormula.version_formula) -> string) ->
(explanation list * Action.t list list) ->
stringval conflict_explanations :
OpamTypes.package_set ->
((OpamTypes.name * OpamFormula.version_formula) -> string) ->
conflict ->
(string * string list * string list) list * string listReturns two lists:
val string_of_explanation :
((OpamTypes.name * OpamFormula.version_formula) -> string) ->
explanation ->
string * string list * string listval conflict_explanations_raw :
OpamTypes.package_set ->
conflict ->
explanation list * Action.t list listProperly concat a single conflict as returned by conflict_explanations for display
val conflict_cycles :
conflict ->
OpamTypes.package OpamTypes.action list list optionval dump_universe : Stdlib.out_channel -> Cudf.universe -> unitDumps the given cudf universe to the given channel
val string_of_atom : Cudf_types.vpkg -> stringPretty-print atoms
val string_of_request : Cudf_types.vpkg OpamTypes.request -> stringPretty-print requests
val string_of_universe : Cudf.universe -> stringPretty-print the universe
val string_of_packages : Cudf.package list -> stringPretty-print of packages
val cudf2opam : Cudf.package -> OpamTypes.packageConvert a cudf package back to an OPAM package
val packages : Cudf.universe -> Cudf.package listReturns the list of packages in a Cudf universe
val to_cudf :
Cudf.universe ->
Cudf_types.vpkg OpamTypes.request ->
Cudf.preamble * Cudf.universe * Cudf.requestConverts an OPAM request to a Cudf request. The wish_install field is required to be a conjunction
val action_contents : 'a OpamTypes.action -> 'aLike OpamTypesBase.action_contents but return the single package of remove, install, reinstal, and change action
module Json : sig ... end