Skip to content

Commit ba49de3

Browse files
Add Troubleshooting sexion with rustup components replacing cargo crates
Ref: #118
1 parent 61ad4d7 commit ba49de3

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

+34
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,40 @@ On Windows the following strategy is applied:
4141
* Add the current version to the current executable's extension
4242
* Create an empty file in place of the just-renamed file (this way `cargo install` will "replace" it and not duplicate the entry in `.crates.toml`)
4343

44+
### Troubleshooting
45+
46+
Some crates, like `clippy` and `rustfmt`, have moved from Crates.io to being a `rustup` component.
47+
If you'd installed them beforehand, then added them via `rustup component`, they might not have been removed from the list of crates installed via `cargo install`,
48+
and you [might come across errors](https://github.com/nabijaczleweli/cargo-update/issues/118) such as
49+
```
50+
$ cargo install-update -a
51+
Updating registry 'https://github.com/rust-lang/crates.io-index'
52+
53+
Package Installed Latest Needs update
54+
clippy v0.0.179 v0.0.302 Yes
55+
.....
56+
57+
Updating clippy
58+
Updating crates.io index
59+
Installing clippy v0.0.302
60+
Compiling clippy v0.0.302
61+
error: failed to compile `clippy v0.0.302`, intermediate artifacts can be found at `/tmp/cargo-installxHfj2y`
62+
63+
Caused by:
64+
failed to run custom build command for `clippy v0.0.302`
65+
66+
Caused by:
67+
process didn't exit successfully: `/tmp/cargo-installxHfj2y/release/build/clippy-ffeedc2f188020a4/build-script-build` (exit code: 1)
68+
--- stderr
69+
70+
error: Clippy is no longer available via crates.io
71+
72+
help: please run `rustup component add clippy-preview` instead
73+
```
74+
75+
In that case, run `cargo install --list` to verify that they're still there and `cargo uninstall` them,
76+
which will deregister the `cargo` versions and leave you with the `rustup` ones.
77+
4478
## Special thanks
4579

4680
To all who support further development on Patreon, in particular:

0 commit comments

Comments
 (0)