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

"replacements" #2

Open
Eh2406 opened this issue Oct 29, 2020 · 2 comments
Open

"replacements" #2

Eh2406 opened this issue Oct 29, 2020 · 2 comments

Comments

@Eh2406
Copy link
Member

Eh2406 commented Oct 29, 2020

"replacements" (in cargo the patch section and the replace) are a way to substitute the code for one package with some other code. In dart it is called dependency-overrides

This issue is to split off and continue the conversation from pubgrub-rs/pubgrub#39.

@Eh2406
Copy link
Member Author

Eh2406 commented Oct 29, 2020

To summarize the comments from pubgrub-rs/pubgrub#39 so far:

mpizenberg: pubgrub-rs/pubgrub#39 (comment)

Patch

It seems that a patch replaces directly the list of existing versions of a package by one explicitely provided in the patch. I tend to believe this is then just a matter of doing exactly that a DependencyProvider implementation.

Replace

Are the versions specified authorized to be new (non-existing in crates)? If not, this is just a matter of adjusting the get_dependencies method of a DependencyProvider implementation. If yes, it also needs to adjust the list_available_versions.

@Eh2406
Copy link
Member Author

Eh2406 commented Oct 29, 2020

I think the bugs in Cargo's resolver have to do with the fact that a selected version can report its package name, but with "replacements" that may not be the same as the name the dependency asked for. In pubgrub, thanks to @mpizenberg's foresight to use generics, we know that we never rely on V.get_package() == P for anything, as we did not ask for a get_package method.
As such I think you are wright, it is just technical complexity in the implementation of a DependencyProvider

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

1 participant