package opam-0install

  1. Overview
  2. Docs

Module Make.InputSource

This defines what the solver sees (hiding the raw XML, etc).

include Zeroinstall_solver.S.CORE_MODEL
Sourcemodule Role : sig ... end
Sourcetype impl

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

Sourcetype 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 = private string

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

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

Sourcetype dep_info = {
  1. dep_role : Role.t;
  2. dep_importance : [ `Essential | `Recommended | `Restricts ];
  3. dep_required_commands : command_name list;
}
Sourcetype 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
Sourcetype role_information = {
  1. replacement : Role.t option;
    (*

    Another role that conflicts with this one.

    *)
  2. impls : impl list;
    (*

    Candidates to fill the role.

    *)
}

Information provided to the solver about a role.

Sourcetype restriction

A restriction limits which implementations can fill a role.

Sourcetype machine_group = private string

The solver will avoid selections with mixed machine groups. This is useful if e.g. the CPU supports 32-bit and 64-bit programs, but we can't mix them in a single process. The string simply has to be unique for each group (e.g. "32" and "64").

Sourceval pp_impl : Format.formatter -> impl -> unit
Sourceval pp_command : Format.formatter -> command -> unit
Sourceval implementations : Role.t -> role_information

The list of candidates to fill a role.

Sourceval restrictions : dependency -> restriction list

Restrictions on how the role is filled

Sourceval meets_restriction : impl -> restriction -> bool
Sourceval machine_group : impl -> machine_group option
Sourcetype conflict_class = private string

There can be only one implementation in each conflict class.

Sourceval conflict_class : impl -> conflict_class list

The following are used for diagnostics only

Sourcetype rejection = C.rejection

The reason why the model rejected an implementation before it got to the solver. For example, the implementation was a Windows binary but the host is Linux.

Sourceval rejects : Role.t -> (impl * rejection) list * string list

Get the candidates which were rejected for a role (and not passed to the solver), as well as any general notes and warnings not tied to a particular impl.

Sourceval compare_version : impl -> impl -> int

Used to sort the results.

Sourceval pp_version : Format.formatter -> impl -> unit
Sourceval user_restrictions : Role.t -> restriction option

Get any user-specified restrictions affecting a role. These are used to filter out implementations before they get to the solver.

Sourceval pp_impl_long : Format.formatter -> impl -> unit

A detailed identifier for the implementation. In 0install, this is the version number and part of the hash.

Sourceval format_machine : impl -> string
Sourceval string_of_restriction : restriction -> string
Sourceval describe_problem : impl -> rejection -> string
Sourceval dummy_impl : impl

A dummy implementation, used to get diagnostic information if the solve fails. It satisfies all requirements, even conflicting ones.

OCaml

Innovation. Community. Security.