作者:莫怀嘉805 | 来源:互联网 | 2023-08-30 17:09
I'm using clippy on travis.
As we all know, clippy sometimes fails to catch up in time and a nightly without clippy is shipped.
To mitigate failure of my travis job in this case, I was installing clippy from the git repo if it was not shipped with the nightly:
1 2 3
| `
- if [[ "$CLIPPY" == "true" ]]; then rustup component add clippy-preview --toolchain=nightly || cargo install --git https://github.com/rust-lang-nursery/rust-clippy/ --force clippy ; fi
- if [[ "$CLIPPY" == "true" ]]; then cargo clippy --all-targets --all-features -- -D warnings ; exit ; fi |
`
However it seems this no longer works:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| `
Updating git repository `https://github.com/rust-lang-nursery/rust-clippy/`
Installing clippy v0.0.302 (https://github.com/rust-lang-nursery/rust-clippy/#5afdf8b7)
Updating crates.io index
Compiling byteorder v1.2.6
Compiling term v0.5.1
Compiling clippy v0.0.302 (https://github.com/rust-lang-nursery/rust-clippy/#5afdf8b7)
error: failed to compile `clippy v0.0.302 (https://github.com/rust-lang-nursery/rust-clippy/#5afdf8b7)`, intermediate artifacts can be found at `/tmp/cargo-install6BJ88g`
Caused by:
failed to run custom build command for `clippy v0.0.302 (https://github.com/rust-lang-nursery/rust-clippy/#5afdf8b7)`
process didn't exit successfully: `/tmp/cargo-install6BJ88g/release/build/clippy-22caafa688c56f0f/build-script-build` (exit code: 1)
--- stderr
error: Clippy is no longer available via crates.io
help: please run `rustup component add clippy-preview` instead |
`
该提问来源于开源项目:rust-lang/rust-clippy
Thanks!
The problem is that afaik we cannot force to install (not update-to) a nightly that has clippy, if the latest nightly does not ship clippy.
https://github.com/rust-lang-nursery/rustup.rs/issues/1501