Skip to content

Shims should give help message for how to add components #4401

Description

@lolbinarycat

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions