rust-lang / docker-rust

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

Rustfmt is present, while not installed #83

Closed arniu closed 3 years ago

arniu commented 3 years ago

When run the following:

docker run -it --rm rust:buster bash -c "ls -lh --color /usr/local/cargo/bin; rustfmt --version"

I found rustfmt was present, while not installed:

total 147M
-rwxrwxrwx 12 root root 13M Mar 26 09:46 cargo
-rwxrwxrwx 12 root root 13M Mar 26 09:46 cargo-clippy
-rwxrwxrwx 12 root root 13M Mar 26 09:46 cargo-fmt
-rwxrwxrwx 12 root root 13M Mar 26 09:46 cargo-miri
-rwxrwxrwx 12 root root 13M Mar 26 09:46 clippy-driver
-rwxrwxrwx 12 root root 13M Mar 26 09:46 rls
-rwxrwxrwx 12 root root 13M Mar 26 09:46 rust-gdb
-rwxrwxrwx 12 root root 13M Mar 26 09:46 rust-lldb
-rwxrwxrwx 12 root root 13M Mar 26 09:46 rustc
-rwxrwxrwx 12 root root 13M Mar 26 09:46 rustdoc
-rwxrwxrwx 12 root root 13M Mar 26 09:46 rustfmt
-rwxrwxrwx 12 root root 13M Mar 26 09:46 rustup
error: 'rustfmt' is not installed for the toolchain '1.51.0-x86_64-unknown-linux-gnu'
To install, run `rustup component add rustfmt`

According the the Dockerfile, rustup-init will install minimal profile-ed components, which means it will install rustc, rust-std, and cargo only, not including rustfmt or others.

Maybe rustup-init should be blamed.

sfackler commented 3 years ago

Those are wrapper binaries that rustup uses to delegate to the proper toolchain. You'd need to file an issue with rustup if you want to change how they work.