cargo::core::resolver

Function resolve

source
pub fn resolve(
    summaries: &[(Summary, ResolveOpts)],
    replacements: &[(PackageIdSpec, Dependency)],
    registry: &mut dyn Registry,
    version_prefs: &VersionPreferences,
    resolve_version: ResolveVersion,
    gctx: Option<&GlobalContext>,
) -> CargoResult<Resolve>
Expand description

Builds the list of all packages required to build the first argument.

  • summaries - the list of package summaries along with how to resolve their features. This is a list of all top-level packages that are intended to be part of the lock file (resolve output). These typically are a list of all workspace members.

  • replacements - this is a list of [replace] directives found in the root of the workspace. The list here is a PackageIdSpec of what to replace and a Dependency to replace that with. In general it’s not recommended to use [replace] any more and use [patch] instead, which is supported elsewhere.

  • registry - this is the source from which all package summaries are loaded. It’s expected that this is extensively configured ahead of time and is idempotent with our requests to it (aka returns the same results for the same query every time). Typically this is an instance of a PackageRegistry.

  • version_prefs - this represents a preference for some versions over others, based on the lock file or other reasons such as [patch]es.

  • resolve_version - this controls how the lockfile will be serialized.

  • config - a location to print warnings and such, or None if no warnings should be printed