Rustup: Difference between toolchain and target

I just noticed that rustup can install toolchains and targets completely separate of each other. For example here I have installed three targets but only one toolchain:

$ rustup target list
[...]
wasm32-unknown-unknown
wasm32-wasi (installed)
x86_64-apple-darwin
x86_64-apple-ios
x86_64-fortanix-unknown-sgx
x86_64-fuchsia
x86_64-linux-android
x86_64-pc-windows-gnu (installed)
x86_64-pc-windows-msvc (installed)
x86_64-rumprun-netbsd
[...]

$ rustup toolchain list
nightly-x86_64-pc-windows-gnu (default)

What components/functionalities/files are part of the target and which are part of the toolchain?

The toolchain is made up of all the parts that run on your current host: cargo, rustc, etc.

The target has the parts needed to compile for a specific target environment, which may be different than the host. This is primarily the compiled standard library, but may also include additional runtime objects needed to link executables for that target.

1 Like

Oh, so the toolchain is completely host-specific, I see.