package 0install-solver

  1. Overview
  2. Docs

Select a compatible set of components to run a program. See Zeroinstall.Solver for the instantiation of this functor on the actual 0install types.

Parameters

Signature

module Output : S.SOLVER_RESULT with module Input = Input

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.

val do_solve : closest_match:bool -> Input.requirements -> Output.t option

do_solve model req finds an implementation matching the given requirements, plus any other implementations needed to satisfy its dependencies.

  • parameter closest_match

    adds a lowest-ranked (but valid) implementation (Input.dummy_impl) to every interface, so we can always select something. Useful for diagnostics. You should ensure that Input.get_command always returns a dummy command for dummy_impl too. Note: always try without closest_match first, or it may miss a valid solution.

  • returns

    None if the solve fails (only happens if closest_match is false).