Skip to content

Cargo install has no way of upgrading #1997

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
clarfonthey opened this issue May 9, 2017 · 10 comments
Closed

Cargo install has no way of upgrading #1997

clarfonthey opened this issue May 9, 2017 · 10 comments
Labels
T-cargo Relevant to the Cargo team, which will review and decide on the RFC.

Comments

@clarfonthey
Copy link

It'd be nice if there were a cargo install --upgrade or similar flag that would cargo install --force a crate if its version has been bumped. This could be configured to only allow major, minor, or bugfix releases.

@mark-i-m
Copy link
Member

I just had to deal with this again yesterday...

It would also be kind of nice to have cargo update similar to rustup update

@est31
Copy link
Member

est31 commented May 11, 2017

cc rust-lang/cargo#2082

@japaric
Copy link
Member

japaric commented Jun 14, 2017

FWIW, there's a (non official) Cargo subcommand that does this.

@Centril
Copy link
Contributor

Centril commented Sep 11, 2017

@japaric that's nice (it doesn't always compile tho...), but this should really be part of cargo proper and not relegated to a subcommand.

@Centril Centril added the T-cargo Relevant to the Cargo team, which will review and decide on the RFC. label Dec 6, 2017
@beatgammit
Copy link

Some related things I'd like from cargo:

  • list of installed things
  • versions of installed things and whether there are updates
  • ability to upgrade multiple things

I try to move toward repository versions of things once they land (e.g. ripgrep), but sometimes that's just not going to happen (e.g. cargo subcommands). I like to stay up-to-date (mostly for latest bugfixes), and it would be nice if there was a simple command I could run to update everything, or at least give me a list of stuff to update.

This probably belongs in a separate RFC, but I feel it's relevant to the discussion here and I'd like to see resolution on this before submitting a separate RFC.

@steveklabnik
Copy link
Member

@beatgammit https://crates.io/crates/cargo-update has all of that.

@beatgammit
Copy link

beatgammit commented Aug 6, 2018

Sweet, thanks! In that case, I'm on board with not doing this in cargo to highlight that it's not meant for managing packages.

Honestly, cargo install --list already solves my first bullet point and half of the second, and I can always do cargo search to manually check for versions of things. The only think I may add is having cargo install --list check the registry cache for updated versions, but that's really it. However, I don't think it's really necessary for cargo to do this.

@nashley
Copy link

nashley commented Jan 10, 2021

to highlight that it's not meant for managing packages

Is this still true? cargo is used by a number of programs as an installation tool. Why should it not be in the business of package management?

@Eh2406
Copy link
Contributor

Eh2406 commented Jan 18, 2022

When cargo install is run on something that is already installed it now looks to update.

@Eh2406 Eh2406 closed this as completed Jan 18, 2022
@nashley
Copy link

nashley commented Jan 26, 2022

rust-lang/cargo#9527 further expands on this to include updating all installed packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-cargo Relevant to the Cargo team, which will review and decide on the RFC.
Projects
None yet
Development

No branches or pull requests

9 participants