brson/multirust

`multirust default <toolchain>` doesn't handle manual uninstallation of a toolchain properly

yberreby opened this issue · 1 comments

$ /Users/yberreby/.multirust/toolchains/nightly/lib/rustlib/uninstall.sh
...
$ multirust default nightly
multirust: using existing install for 'nightly'
multirust: default toolchain set to 'nightly'
$ rustc
/usr/local/bin/rustc: line 120: /Users/yberreby/.multirust/toolchains/nightly/bin/rustc: No such file or directory
/usr/local/bin/rustc: line 120: exec: /Users/yberreby/.multirust/toolchains/nightly/bin/rustc: cannot execute: No such file or directory

I'm pretty sure multirust default nightly should detect that the nightly toolchain is missing, and reinstall it, instead of happily reusing an existing install that doesn't actually exist.

brson commented

It could do better in this situation for sure.

uninstall.sh leaves some directory structure around (because it assumes it could be uninstalling from e.g /) so multirust sees the directory and assumes it has a toolchain.

One general thing that might improve the errors is for multirustproxy to test that a binary actually exists before running it and print a nicer error.