You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary
Instead of failing when cargo install detects a package is already installed, it will upgrade if the versions don't match, or do nothing (exit 0) if it is considered "up-to-date".
cargo +nightly install foo -Z install-upgrade
Unresolved questions
Is it tracking the correct information? There are many other settings that could be tracked (rustc, env variables, changes in dependencies in Cargo.lock, mtime for path sources, etc). The current set was chosen to be practical and simple and should cover most use cases. Otherwise --force is intended as a workaround for more advanced requirements.
Should this be the new default? Should there be an option to disable upgrades and revert to the old behavior?
If a new version of a package drops a binary, should those dropped binaries be uninstalled when the new package is installed? Currently it only replaces binaries. Fixed in cargo install: Remove orphaned executables. #7246
Original issue: #6667
Implementation PR: #6798
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#install-upgrade
Summary
Instead of failing when
cargo installdetects a package is already installed, it will upgrade if the versions don't match, or do nothing (exit 0) if it is considered "up-to-date".Unresolved questions
Cargo.lock, mtime for path sources, etc). The current set was chosen to be practical and simple and should cover most use cases. Otherwise--forceis intended as a workaround for more advanced requirements.cargo installwith upgrades #6667 for more about this.)--no-trackbe kept, or is there a better approach for packaging? Does it have the right behavior? See also Please provide a cargo install option to not write .crates.toml #3316.If a new version of a package drops a binary, should those dropped binaries be uninstalled when the new package is installed? Currently it only replaces binaries.Fixed incargo install: Remove orphaned executables. #7246