Skip to content

universal-lock: refactor resolver state into explicit type #3354

@BurntSushi

Description

@BurntSushi

Currently, our resolver's state (managed across different calls to unit propagation) is tracked implicitly on the stack of our solve routine:

) -> Result<ResolutionGraph, ResolveError> {
let root = PubGrubPackage::Root(self.project.clone());
let mut prefetcher = BatchPrefetcher::default();
// Keep track of the packages for which we've requested metadata.
let mut pins = FilePins::default();
let mut priorities = PubGrubPriorities::default();
// Start the solve.
let mut state = State::init(root.clone(), MIN_VERSION.clone());
let mut added_dependencies: FxHashMap<PubGrubPackage, FxHashSet<Version>> =
FxHashMap::default();
let mut next = root;

This state needs to get pushed out into its own type so that we can work with it more explicitly. For example, as part of #3350, we'll need to be able to fork the resolver and thus will need to be able to clone the state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    previewExperimental behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions