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 upgrade or ignore, right? #13295

Closed
frederikhors opened this issue Jan 14, 2024 · 2 comments
Closed

cargo install should upgrade or ignore, right? #13295

frederikhors opened this issue Jan 14, 2024 · 2 comments
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.

Comments

@frederikhors
Copy link

frederikhors commented Jan 14, 2024

Problem

After #7560 I thought that cargo install foo should upgrade or ignore foo if already installed and instead cargo gives me this error:

cargo install foo
    Updating crates.io index
error: binary `cargo-install-foo.exe` already exists in destination
binary `cargo-install-foo.exe` already exists in destination
Add --force to overwrite

Why?

Version

cargo 1.75.0 (1d8b05cdd 2023-11-20)
release: 1.75.0
commit-hash: 1d8b05cdd1287c64467306cf3ca2c8ac60c11eb0
commit-date: 2023-11-20
host: x86_64-pc-windows-msvc
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:Schannel)
os: Windows 10 (Windows 10 Pro) [64-bit]
@frederikhors frederikhors added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Jan 14, 2024
@Nemo157
Copy link
Member

Nemo157 commented Jan 14, 2024

Check the contents of ~/.cargo/.crates2.json, that is where it stores details on previously installed packages, if that has been wiped for some reason it won't know that the ~/.cargo/bin/cargo-install-foo.exe was installed through cargo install.

@frederikhors
Copy link
Author

You're right. I deleted that file because of the slowness of the indexing after cargo update command the other day. It works now! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants