-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
cargo uninstall
doesn't take into account that the crate being uninstalled may in fact be running, and that attempting to delete such an executable will fail on Windows. Because removing the binary is the last step in the uninstall process, this leads to a phenonemon I dub "Schrödinger's crate", in which a crate is both installed and uninstalled; the executable still exists, so cargo install
fails, but all installation metadata is gone, so cargo uninstall
fails!
One way to cause this is via the Rusty Code plugin for VS Code; it depends on Racer, which can be installed via cargo install
and is active while Rusty Code is active. Trying to cargo uninstall
Racer in this situation leads to breakage as described above.
You can work around this by deleting the leftover executable after making sure it isn't running; cargo install --force
also works.
Tested with the latest nightly Rust, installed via rustup-rs
:
rustc 1.15.0-nightly (908dba0c9 2016-12-01)
binary: rustc
commit-hash: 908dba0c9477b7dd022a236cb1514ddfca9369f2
commit-date: 2016-12-01
host: x86_64-pc-windows-msvc
release: 1.15.0-nightly
LLVM version: 3.9
cargo 0.16.0-nightly (3568be9 2016-11-26)