- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.7k
Closed
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-add
Description
Problem
cargo add current does not update Cargo.lock after updating Cargo.toml. That means that the user needs to run some other command to update it. In most cases, this is fine, as most users will then run build or check to use their new dependency. However, some commands do not work (such as cargo pkgid, cargo update -p NEW_DEP, etc.). Additionally, it may be possible that the new dependency doesn't resolve at all (such as a conflict with another dependency).
Proposed Solution
Update Cargo.lock for just the new dependency (essentially, the equivalent of what cargo build and friends do when Cargo.toml changes).
If the update fails, I'm not sure what it should do, but I would lean towards backing out any changes made.
Notes
cargo 1.64.0-nightly (d8d30a753 2022-07-19)
Metadata
Metadata
Assignees
Labels
C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-add