Skip to content

cargo install cargo-binutils failed to install on top of older cargo-binutils #6622

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
eddyp opened this issue Feb 3, 2019 · 3 comments
Closed
Labels
C-bug Category: bug

Comments

@eddyp
Copy link

eddyp commented Feb 3, 2019

Problem

Going through the embedonimicon, I tried to install cargo-binutils, forgetting I already had it installed, but the install failed.

Steps

  1. have cargo-binutils 0.1.5 installed
  2. running cargo install cargo-binutils results in an error, which seems suggesting a wrong solution:
eddy@feodora:~/usr/src/rust$ cargo install cargo-binutils
    Updating crates.io index
  Downloaded cargo-binutils v0.1.6
  Downloaded 1 crates (17.9 KB) in 1.56s
  Installing cargo-binutils v0.1.6
error: binary `cargo-nm` already exists in destination as part of `cargo-binutils v0.1.5`
binary `cargo-objcopy` already exists in destination as part of `cargo-binutils v0.1.5`
binary `cargo-objdump` already exists in destination as part of `cargo-binutils v0.1.5`
binary `cargo-profdata` already exists in destination as part of `cargo-binutils v0.1.5`
binary `cargo-readobj` already exists in destination as part of `cargo-binutils v0.1.5`
binary `cargo-size` already exists in destination as part of `cargo-binutils v0.1.5`
binary `cargo-strip` already exists in destination as part of `cargo-binutils v0.1.5`
Add --force to overwrite

If I uninstall first cargo-binutils, then try again, everything works:

eddy@feodora:~/usr/src/rust$ cargo uninstall cargo-binutils
    Removing /home/eddy/.cargo/bin/cargo-nm
    Removing /home/eddy/.cargo/bin/cargo-objcopy
    Removing /home/eddy/.cargo/bin/cargo-objdump
    Removing /home/eddy/.cargo/bin/cargo-profdata
    Removing /home/eddy/.cargo/bin/cargo-readobj
    Removing /home/eddy/.cargo/bin/cargo-size
    Removing /home/eddy/.cargo/bin/cargo-strip
eddy@feodora:~/usr/src/rust$ cargo install cargo-binutils
    Updating crates.io index
  Installing cargo-binutils v0.1.6
   Compiling proc-macro2 v0.4.27
   Compiling unicode-xid v0.1.0
[...]
   Compiling cargo-binutils v0.1.6
    Finished release [optimized] target(s) in 51.35s
  Installing /home/eddy/.cargo/bin/cargo-strip
  Installing /home/eddy/.cargo/bin/cargo-objdump
  Installing /home/eddy/.cargo/bin/cargo-readobj
  Installing /home/eddy/.cargo/bin/cargo-objcopy
  Installing /home/eddy/.cargo/bin/cargo-profdata
  Installing /home/eddy/.cargo/bin/cargo-nm
  Installing /home/eddy/.cargo/bin/cargo-size

Possible Solution(s)

Notes

Output of cargo version:
cargo 1.32.0 (8610973 2019-01-02)

eddy@feodora:~/usr/src/rust$ rustup toolchain list
stable-x86_64-unknown-linux-gnu (default)
nightly-2018-11-30-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu
eddy@feodora:~/usr/src/rust$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
eddy@feodora:~/usr/src/rust$ uname -a
Linux feodora 4.18.0-14-generic #15~18.04.1-Ubuntu SMP Mon Jan 14 11:09:26 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
@eddyp eddyp added the C-bug Category: bug label Feb 3, 2019
@ehuss
Copy link
Contributor

ehuss commented Feb 3, 2019

which seems suggesting a wrong solution:

I'm not sure I understand this issue. It is suggesting adding the --force flag which should work. Did it not work?

@eddyp
Copy link
Author

eddyp commented Feb 3, 2019

which seems suggesting a wrong solution:

I'm not sure I understand this issue. It is suggesting adding the --force flag which should work. Did it not work?

I would have expected that cargo would have upgraded the cargo-binutils package instead of suggesting --force, which I suspect might be dangerous or might have ill effects. So I'd say it should have uninstalled the old and installed the new, instead of suggesting --force.

@ehuss
Copy link
Contributor

ehuss commented Feb 3, 2019

Ah, thanks! There are quite a few requests for that behavior (#6485, #2082), so I'm going to close in favor of those.

@ehuss ehuss closed this as completed Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants