Skip to content
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

Implement a souped up version of resolve #717

Closed
wants to merge 9 commits into from

Conversation

Projects
None yet
2 participants
@alexcrichton
Copy link
Member

alexcrichton commented Oct 17, 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

@alexcrichton alexcrichton force-pushed the alexcrichton:souped-up-resolve branch from d62d323 to 0c8f768 Oct 17, 2014

alexcrichton added some commits Oct 16, 2014

Split out encoding from `core::resolver` to a submodule
Same exported hierarchy, just some internal orgainzational changes.
Implement resolution of version requirements
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.
Make PackageId cheap to clone
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.
Make SourceId cheap to clone
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.
Continue reducing clone costs
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.
Avoid visiting deps too often in resolve
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.

@alexcrichton alexcrichton force-pushed the alexcrichton:souped-up-resolve branch from 0c8f768 to 7db89ed Oct 22, 2014

@alexcrichton

This comment has been minimized.

Copy link
Owner Author

alexcrichton commented on 7db89ed Oct 22, 2014

r=wycats

@bors

This comment has been minimized.

Copy link
Contributor

bors commented on 7db89ed Oct 22, 2014

saw approval from wycats
at alexcrichton@7db89ed

This comment has been minimized.

Copy link
Contributor

bors replied Oct 22, 2014

merging alexcrichton/cargo/souped-up-resolve = 7db89ed into auto-cargo

This comment has been minimized.

Copy link
Contributor

bors replied Oct 22, 2014

alexcrichton/cargo/souped-up-resolve = 7db89ed merged ok, testing candidate = cdc85ff

bors added a commit that referenced this pull request Oct 22, 2014

auto merge of #717 : alexcrichton/cargo/souped-up-resolve, r=wycats
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
@alexcrichton

This comment has been minimized.

Copy link
Owner Author

alexcrichton commented on ba17dae Oct 22, 2014

r=wycats

This comment has been minimized.

Copy link
Owner Author

alexcrichton replied Oct 22, 2014

p=1

@bors

This comment has been minimized.

Copy link
Contributor

bors commented on ba17dae Oct 22, 2014

saw approval from wycats
at alexcrichton@ba17dae

This comment has been minimized.

Copy link
Contributor

bors replied Oct 22, 2014

merging alexcrichton/cargo/souped-up-resolve = ba17dae into auto-cargo

This comment has been minimized.

Copy link
Contributor

bors replied Oct 22, 2014

alexcrichton/cargo/souped-up-resolve = ba17dae merged ok, testing candidate = 519b8e0

This comment has been minimized.

Copy link
Contributor

bors replied Oct 22, 2014

fast-forwarding master to auto-cargo = 519b8e0

bors added a commit that referenced this pull request Oct 22, 2014

auto merge of #717 : alexcrichton/cargo/souped-up-resolve, r=wycats
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

@bors bors closed this Oct 22, 2014

@alexcrichton alexcrichton deleted the alexcrichton:souped-up-resolve branch Oct 22, 2014

@alexcrichton alexcrichton restored the alexcrichton:souped-up-resolve branch Oct 24, 2014

@alexcrichton alexcrichton deleted the alexcrichton:souped-up-resolve branch Oct 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.