package 0install-solver

  1. Overview
  2. Docs

Module Make.OutputSource

The result of running the solver. Unlike the plain SELECTIONS type, this type can relate the selections back to the solver inputs, which is useful to provide diagnostics and the GUI.

module Input = Input
include S.SELECTIONS with module Role = Input.Role and type command = Input.command and type dependency = Input.dependency and type command_name = Input.command_name and type dep_info = Input.dep_info and type requirements = Input.requirements
include S.CORE_MODEL with module Role = Input.Role with type command = Input.command with type dependency = Input.dependency with type command_name = Input.command_name with type dep_info = Input.dep_info with type requirements = Input.requirements
module Role = Input.Role
Sourcetype impl

An impl is something that can fill a Role.t (e.g. a particular version of a package).

Sourcetype command = Input.command

A command is an entry-point provided by an implementation. Using a command may require extra dependencies (for example, a "test" command might depend on a test runner).

Sourcetype command_name = Input.command_name

An identifier for a command within a role. Note: It might not be necessary to use any commands - we could instead treat the command name as an optional part of the role, and treat each command as a separate impl instead.

Sourcetype dependency = Input.dependency

A dependency indicates that an impl or command requires another role to be filled.

Sourcetype dep_info = Input.dep_info = {
  1. dep_role : Role.t;
  2. dep_importance : [ `Essential | `Recommended | `Restricts ];
  3. dep_required_commands : command_name list;
}
Sourcetype requirements = Input.requirements = {
  1. role : Role.t;
  2. command : command_name option;
}
Sourceval requires : Role.t -> impl -> dependency list * command_name list

Get an implementation's dependencies.

The dependencies should be ordered with the most important first. The solver will prefer to select the best possible version of an earlier dependency, even if that means selecting a worse version of a later one (restricts_only dependencies are ignored for this).

An implementation or command can also bind to itself. e.g. "test" command that requires its own "run" command. We also return all such required commands.

Sourceval dep_info : dependency -> dep_info
Sourceval command_requires : Role.t -> command -> dependency list * command_name list

As requires, but for commands.

Sourceval get_command : impl -> command_name -> command option
Sourcemodule RoleMap : Map.S with type key = Role.t
Sourcetype t
Sourceval to_map : t -> impl RoleMap.t
Sourceval get_selected : Role.t -> t -> impl option
Sourceval selected_commands : impl -> command_name list
Sourceval requirements : t -> requirements
Sourceval unwrap : impl -> Input.impl
Sourceval explain : t -> Role.t -> string

Get diagnostics-of-last-resort.

OCaml

Innovation. Community. Security.