Skip to content
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

cargo install should check if binary isn't installed/outdated before downloading crate and it shouldn't fail otherwise #6485

Closed
I60R opened this issue Dec 26, 2018 · 5 comments · Fixed by #7560
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-install

Comments

@I60R
Copy link

I60R commented Dec 26, 2018

Currently with cargo:

$ cargo install cargo-pkgbuild         # I have it already installed                                                                                                                                                                            
    Updating crates.io index
  Downloaded cargo-pkgbuild v0.1.1
  Downloaded 1 crates (717.7 KB) in 10.13s
  Installing cargo-pkgbuild v0.1.1
error: binary `cargo-pkgbuild` already exists in destination as part of `cargo-pkgbuild v0.1.1 (/home/igor/Rust/cargo-pkgbuild)`
Add --force to overwrite

This exits with 101 error code. But for me it seems that downloading crate and issuing an error here doesn't make any sense.

E.g. rustup has expected behavior:

$ rustup component add clippy              # It's also installed
info: component 'clippy' for target 'x86_64-unknown-linux-gnu' is up to date

This exits with 0.


Just failed into that on CI setup and wondered why this problem exists at all

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

k-nasa commented Jan 13, 2019

I'll take this task, is it ok❓

@dwijnand
Copy link
Member

Sure! Btw, I recently discovered https://crates.io/crates/cargo-ensure-installed which seems to be the workaround for this.

@k-nasa
Copy link
Contributor

k-nasa commented Jan 15, 2019

OK! Thank you

@colindean
Copy link
Contributor

I encountered this just now while setting up a new project that needed a few cargo-provided binaries to be available as a part of a make task. I'd love to see this built into cargo install as an option, perhaps --ensure or something like that.

@ehuss
Copy link
Contributor

ehuss commented Mar 2, 2019

Pinging anyone following this issue, I have a proposal to add upgrade functionality to cargo install at #6667. If you have any comments, I would appreciate if you can leave some over on that issue.

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` Command-install
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants