Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Include rustfmt and clippy #25

Open
mleonhard opened this issue Oct 29, 2020 · 3 comments
Open

Include rustfmt and clippy #25

mleonhard opened this issue Oct 29, 2020 · 3 comments

Comments

@mleonhard
Copy link

Thanks for making this docker image. I'm using it with Gitlab CI. One issue is that many nightly versions have no rustfmt or clippy.

How about including the latest rustfmt and clippy in the image? This would help me out a lot. It would speed up CI jobs, reduce CI flakiness from download errors, and eliminate the need for extra docker images.

@mleonhard
Copy link
Author

Example error:

$ date -u
Thu Oct 29 07:41:32 UTC 2020
$ docker images --all |grep rustlang
rustlang/rust                                     nightly             e40103be369d        13 hours ago        1.6GB
$ docker run --interactive --tty --rm rustlang/rust:nightly
root@56ce9e3100f5:/# mkdir pkg1 
root@56ce9e3100f5:/# cd pkg1
root@56ce9e3100f5:/pkg1# export USER=user1
root@56ce9e3100f5:/pkg1# cargo init
     Created binary (application) package
root@56ce9e3100f5:/pkg1# cargo fmt --all -- --check
error: the 'rustfmt' component which provides the command 'cargo-fmt' is not available for the 'nightly-x86_64-unknown-linux-gnu' toolchain

@mleonhard
Copy link
Author

The instrumentisto/rust images have clippy and rustfmt.

Related: "Include rustfmt and clippy components by default" rust-lang/docker-rust#37

@tyranron
Copy link
Contributor

@mleonhard instrumentisto/rust nightly images are nothing more than these rustlang/rust:nightly images. All the instrumentisto does about nightly images is just preserving all the versions in tags. So there is literally no difference between them (you can even compare the hash of latest image to ensure).

But... not every nightly Rust version has rustfmt, clippy or other components. Sometimes nightly version misses them. You can track the components availability here: https://rust-lang.github.io/rustup-components-history/index.html

But beware, that nightly version tag in instrumentisto/rust differs with the one published on the page by one day. That's because rustc version shipped in nightly version is always of the previous day, and Docker image is tagged by taking the rustc version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants