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

Document the resolver in online documentation #7301

Closed
alexcrichton opened this issue Aug 26, 2019 · 2 comments · Fixed by #8609
Closed

Document the resolver in online documentation #7301

alexcrichton opened this issue Aug 26, 2019 · 2 comments · Fixed by #8609
Labels
A-dependency-resolution Area: dependency resolution and the resolver A-documenting-cargo-itself Area: Cargo's documentation

Comments

@alexcrichton
Copy link
Member

Raised by @ehuss here it's long overdue that the general algorithm of the resolver is documented in the Cargo book (https://doc.rust-lang.org/cargo/).

I think we don't necessarily need to document the whole algorithm per se, but we should go into detail about the various constraints that the resolver is solving for and what a "human readable description" of the problem the resolver is solving is doing. This is where we'd also document the interaction of [patch] with the resolver as well.

cc @Eh2406, you're likely interested in this!

@ehuss
Copy link
Contributor

ehuss commented Aug 26, 2019

Yea, I don't think the specifics of the algorithm need to be documented. I do envision adding some high-level user-oriented help for how dependencies work and the consequences of using semver versions. The following are some ideas for things I think would be nice to cover (and currently has little-to-no docs):

  • Explain how semver-compatible dependencies are unified to a single version.
    • And explain what "semver-compatible" is, along with examples.
    • Add a little extra emphasis on how API-compatibility relates with "semver-compatible" (and rfc 1105).
    • Explain some of the consequences of not having unified dependencies (like linking both version 1.0 and 2.0 of a lib). For example, downcast-ref can silently break.
  • Maybe document how features are unified? I'm reluctant to do so now, since the way it works currently is not great.
  • How [patch] works.
  • Recommendations on how to manage dependencies and versions.
  • How to resolve common problems.

I'm sure we can brainstorm other ideas. I'd personally prefer to gear it towards new/intermediate users, rather than discussing algorithm details.

Here are some examples of other projects:
https://docs.microsoft.com/en-us/nuget/concepts/dependency-resolution
https://golang.github.io/dep/docs/the-solver.html
http://ant.apache.org/ivy/history/latest-milestone/principle.html

@ehuss ehuss added the A-documenting-cargo-itself Area: Cargo's documentation label Aug 26, 2019
@Eh2406 Eh2406 added the A-dependency-resolution Area: dependency resolution and the resolver label Aug 26, 2019
@Eh2406
Copy link
Contributor

Eh2406 commented Aug 26, 2019

We from time to time get people that think that Cargo will only bring in 2 versions iif there is a ^ in a dependency (#6876 (comment)). And other in-corect variation on how things work. A chapter to point them to would be great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependency-resolution Area: dependency resolution and the resolver A-documenting-cargo-itself Area: Cargo's documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants