-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add support for managing "[patch.crates-io]" #274
Comments
@killercup Would a PR be accepted that implements this to an extent? |
This functionality seems useful, but I'm not convinced about adding new commands for that and not e.g. using |
Agreed. It's a good feature to have, especially if we can make it work smoothly (e.g. by checking that the path contains the expected crate and other things you'd not get by editing the file by hand). |
I've started working on a separate crate that dose this called I'd like to spend some time experimenting with the interface in a separate repo. Long term it'd be great to integrate it into I'll share it here as soon as I have an MVP. |
Some related cargo issues with additional ideas and potential existing commands |
I've released a working version of https://github.com/eopb/cargo-override |
The proposal is to allow cargo-edit to manage this Cargo feature:
https://rust-lang-nursery.github.io/edition-guide/rust-2018/cargo-and-crates-io/replacing-dependencies-with-patch.html
The command
cargo add-patch frob --path=~/frob
would add a line to apatch
section inCargo.toml
:The
cargo rm-patch frob
would remove this line.Some complexities / open questions:
crates-io
). This could be specified using an extra argument that defaults to the default repository, but the naming of that argument is a bit tricky since you are potentially dealing with two repository names (the original one and the override). We could also in theory try to auto-detect the repository name by searching the dependency graph for the named crate, but (again, in theory) I think it might be possible to find two crates with the same name in the dependency graph from different repositories?Edit: Made various changes after thinking about it some more.
The text was updated successfully, but these errors were encountered: