Skip to content

Missing cargo install --upgrade #6475

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

Closed
mqudsi opened this issue Dec 22, 2018 · 1 comment
Closed

Missing cargo install --upgrade #6475

mqudsi opened this issue Dec 22, 2018 · 1 comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@mqudsi
Copy link

mqudsi commented Dec 22, 2018

The current procedure for updating a binary installed via cargo isn't ergonomic and is prone to human error, as there is no one-stop process for installing an updated version of a package if it exists, else leaving the current version undisturbed.

The default behavior of cargo install foo when foo is already installed is to fail to install with an error message that contains enough information to determine whether or not the output is out of date:

~> cargo install racer
    Updating crates.io index
  Installing racer v2.1.16
error: binary `racer` already exists in destination as part of `racer v2.1.16`
Add --force to overwrite

So the current process for possibly upgrading a package requires

  1. cargo install foo
  2. Observe the output and compare the information about the currently installed version of foo vs the version of foo that was found in the index.
  3. If an upgrade is available, run cargo install foo again, but this time with the --force flag.

(The alternative is to use --force from the beginning, forcing a lengthy recompile process and wasting far more time than the above.)

@mqudsi mqudsi added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Dec 22, 2018
@ehuss
Copy link
Contributor

ehuss commented Dec 22, 2018

Thanks for the report! This is a duplicate of #2082, so closing in favor of that. There's cargo-update which handles upgrades.

@ehuss ehuss closed this as completed Dec 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

2 participants