cargo icon indicating copy to clipboard operation
cargo copied to clipboard

Change `cargo install` error on corrupt metadata to warning

Open jarkkojs opened this issue 1 year ago • 2 comments

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

jarkkojs avatar Jun 05 '23 11:06 jarkkojs