-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Implement a souped up version of resolve #717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d62d323
to
0c8f768
Compare
Same exported hierarchy, just some internal orgainzational changes.
This commit extends the support in cargo's resolver to start resolving packages with multiple versions as well as package requirements. This is a crucial step forward when impelmenting the cargo registry as multiple versions will be uploaded to the registry quite quickly! This implements a fairly naive solution which should at least help cargo get out the gates initially. This impelments a depth-first-search of the pacakage dependency graph with a few sorting heuristics along the way to help out resolution as it goes along. Resolution errors will likely improve over time, but this commit does make an effort to try to get some good error messages right off the bat.
These are cloned a massive number of times during resolution, so let's make them much cheaper to clone with an Arc. This uses Arc instead of Rc because the fiddly bits in job_queue have a PackageId cross task boundaries for parallelism.
Like PackageId, these are cloned quite often, so this moves them into an Arc to make them cheap to clone. This also removes the public fields in favor of accessors.
Share the `visited` hash set among all contexts, just be sure to maintain it across failures. Also put all Summary structures into an `Rc` as they're cloned quite frequently.
If we're activating an already-active version of a dependency, then there's no need to actually recurse into it. Instead, we can skip it if we're not enabling any extra features in it to avoid extraneous recursion.
0c8f768
to
7db89ed
Compare
bors
added a commit
that referenced
this pull request
Oct 22, 2014
This series of commits is rebased on top of #712 to avoid conflicts, and it adds the ability to solve version constraints as part of the resolution process. This is a critical step forward in bringing the registry online as it makes it possible for cargo to figure out what to do in the face of many uploaded versions of a package to the registry. r? @wycats
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This series of commits is rebased on top of #712 to avoid conflicts, and it adds the ability to solve version constraints as part of the resolution process. This is a critical step forward in bringing the registry online as it makes it possible for cargo to figure out what to do in the face of many uploaded versions of a package to the registry.
r? @wycats