Change `cargo install` error on corrupt metadata to warning
Open
Nobody has claimed this yet.
C-bug
Command-uninstall
S-needs-info
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
Problem
This transcript emphasizes the problem:
$ cargo uninstall zellij
error: corrupt metadata, `/home/jarkko/.cargo/bin/zellij` does not exist when it should
$ touch .cargo/bin/zellij
$ cargo uninstall zellij
Removing /home/jarkko/.cargo/bin/zellij
$ cargo uninstall zellij
error: package ID specification `zellij` did not match any packages
Why is exiting empty file better than non-existing file? Since cargo does not care of the contents, why is it logical to fail ENOENT case?
Steps
No response
Possible Solution(s)
Change error to warning and proceed on removing the meta-data.
Notes
No response
Version
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the cargo uninstall zellij transcript and trace the cargo uninstall handling for corrupt metadata, especially the missing executable case. Done means the missing-file condition produces a warning, metadata removal continues, and the behavior is covered by an appropriate test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100