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

Provide a default get_preference() implementation #11

Open
uranusjr opened this issue Jan 31, 2020 · 1 comment
Open

Provide a default get_preference() implementation #11

uranusjr opened this issue Jan 31, 2020 · 1 comment

Comments

@uranusjr
Copy link
Member

Cargo sorts the resolution order by number of available candidates (resolve package with fewer candidates first). This matches my (instinctive) choice in Passa, and could actually be the answer?

https://github.com/rust-lang/cargo/blob/4fbd644bc76e25815a8e3a2189b6430fe69fd0d6/src/cargo/core/resolver/types.rs#L205-L219

https://github.com/sarugaku/passa/blob/2ac00f16cd5a8f07d679a3ab02b7cc13c6f42bee/src/passa/models/providers.py#L44-L47

But I still think more real-world cases need to be tested before we can settle on a good default. (Note that the default implementation should be somewhat cheap, since this is called on every resolution round.)

@pradyunsg
Copy link
Contributor

Using the number of available candidates for a requirement, to determine the order of exploration, sounds like a reasonable default to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants