Problem you are trying to solve
If you try to run a shim from a toolchain that does not have that component, it's not immediatly obvious what the solution is to solve the Unknown binary error.
Solution you'd like
If the toolchain was added via rustup toolchain link, suggest building the component with x.py (oddly, this is the one that is already implemented)
If the toolchain was requested through +TOOLCHAIN or RUSTUP_TOOLCHAIN, emit a help message recommending rustup component add --toolchain TOOLCHAIN COMPONENT.
If the toolchain was the default toolchain, recommend rustup component add COMPONENT (could be merged with previous case for simplicity of implementation)
If the toolchain was from rust-toolchain or rust-toolchain.toml, recommend modifying the file or adding a dir override then adding the component to that toolchain.
Notes
The fact that this is handled for linked toolchains suggests it should probably be handled for other cases too.
The linked toolchain case needs to be checked first because it should always take priority.
Problem you are trying to solve
If you try to run a shim from a toolchain that does not have that component, it's not immediatly obvious what the solution is to solve the
Unknown binaryerror.Solution you'd like
If the toolchain was added via
rustup toolchain link, suggest building the component withx.py(oddly, this is the one that is already implemented)If the toolchain was requested through
+TOOLCHAINorRUSTUP_TOOLCHAIN, emit a help message recommendingrustup component add --toolchain TOOLCHAIN COMPONENT.If the toolchain was the default toolchain, recommend
rustup component add COMPONENT(could be merged with previous case for simplicity of implementation)If the toolchain was from
rust-toolchainorrust-toolchain.toml, recommend modifying the file or adding a dir override then adding the component to that toolchain.Notes
The fact that this is handled for linked toolchains suggests it should probably be handled for other cases too.
The linked toolchain case needs to be checked first because it should always take priority.