I'm trying to install the aarch64-apple-watchos and aarch64-apple-watchos-sim targets but when running rustup target add aarch64-apple-watchos I get the following error:
error: toolchain 'stable-aarch64-apple-darwin' does not support target 'aarch64-apple-watchos'
note: you can see a list of supported targets with `rustc --print=target-list`
note: if you are adding support for a new target to rustc itself, see https://rustc-dev-guide.rust-lang.org/building/new-target.html
But when I run rustc --print=target-list as it suggested, both aarch64-apple-watchos and aarch64-apple-watchos-sim are listed. So if they are in the list of supported targets, why does rustup say that that aren't when I try adding them?
For a compiler “target” is “something I'm generating code for”.
For a rustup “target” is “something I'm installing compiler for”. For the compiler that wouldn't be “target”, for a compiler that would be “host”.
Because aarch64-apple-watchos is supported by Rust as target for the compiler compiler but not as host for the compiler you couldn't install native toolchain with rustup.
Rustc clearly explains that there are no toolchain for iOS, you may only cross-compile.
That is not true. rustup target add installs the standard library of a given target to the current compiler toolchain. It doesn't install a new toolchain with a different host triple. For that you did have to use something like rustup toolchain install --force-non-host <toolchain-name>-<target>. The latter command is generally not really useful as your host likely isn't able to run rustc binaries compiled for a different target.
The issue here is that aarch64-apple-watchos is a tier 3 target, which means no precompiled standard library is available. As such -Zbuild-std is required instead.