Skip to content

Query Installed Components and Toolchains #1658

@naftulikay

Description

@naftulikay

Describe the problem you are trying to solve

I have an Ansible role for installing a Rust development environment on arbitrary Linux machines. One of the features I want to support is to install a list of components. In order to do this, I need some way of querying what is installed and what isn't, so I can only run the rustup component add command when the given component is not installed.

Describe the solution you'd like

If it were possible to do rustup components list --installed, this would satisfy my requirements and generally make scripting around rustup easier.

Notes

Outside of Ansible, this would also be useful in shell scripting:

if ! rustup component list --installed | grep -qP '^rls-x86_64-unknown-linux-gnu' ; then
    rustup component install rls-x86_64-unknown-linux-gnu
fi

More examples can also be thought of, but the use-case should be fairly clear.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions