Skip to content

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

Closed
@I60R

Description

@I60R

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-install

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions