rust-lang / docker-rust

The official Docker images for Rust
436 stars 88 forks source link

Reconsider including rustfmt and clippy in docker image #97

Open strct opened 2 years ago

strct commented 2 years ago

The docker image has a different use case than normal installations, mostly CI. And having rustfmt and clippy available by default would greatly ease their use in CI by having the necessary tools preinstalled and not requiring a network connection to install them for each CI job.

37 was closed by reasoning that this is the responsible of rustup, but they closed it as responsible from docker-rust: https://github.com/rust-lang/rustup/issues/1569#issuecomment-587753207. So I think it is time to reconsider including it in this repository again.

abonander commented 2 years ago

It makes sense to have a tag that doesn't include them by default for automated builders that don't need to do a full series of checks, so I think there should be another tag that includes them. Maybe a -tools suffix to differentiate from the current set of images.

workingjubilee commented 1 year ago

We talked it over in rust-lang/rustup#3078 and basically: we agree with what @abonander says. There's a reason that we recommended the minimal profile initially, because CI at the time had more "simple" builders. It doesn't apply as strongly anymore, but it would be weird to add additional tools you don't always need to the minimal profile. There currently isn't an obvious choice for what a new profile that tries to address the "we need tools" concern should have, without falling into the problems of the complete profile. And the default profile doesn't work because it would add another 600MB of documentation your CI is not going to read.

We'll probably rewrite the recommendation to try to capture this nuance. Maybe in the future we will add such a "tools" profile. It's more likely we'll know what should go into it if other people, including other parts of the Rust project, feel free to add more stuff to things like Docker images instead of just using whatever recommendations we hand down from "on high".