Skip to content

rustup show active-toolchain should provide the toolchain path #4129

Description

@rami3l

Problem you are trying to solve

Let me guess: you actually just want to get the active toolchain path with this snippet...

https://github.com/corrosion-rs/corrosion/blob/b88ec09915a6b12d1aaec7e451ecf0e41a831030/cmake/FindRust.cmake#L423-L428

... however you might have tried the following options and concluded that neither is satisfactory:

  • rustup show active-toolchain. This seems like the most obvious option, however it is somehow not willing to give you the toolchain path...
  • rustup toolchain list --verbose. This does give you the toolchain paths, but you have to manually deduce what the active toolchain is :|

corrosion-rs/corrosion#590 (comment)

Solution you'd like

rustup show active-toolchain should provide the toolchain path, or optionally with --verbose.

Notes

No response

Activity

  1. modified the milestones: 1.28.1, 1.28.0 on Dec 28, 2024
  2. ChrisDenton commented on Dec 28, 2024

    @ChrisDenton
    Member

    I think maybe with --verbose would be better? I worry that people are parsing rustup show active-toolchain so changing it might break scripts, etc. Admittedly, if those scripts are just splitting on the first whitespace then it is less of an issue.

    rustup toolchain list --verbose. This does give you the toolchain paths, but you have to manually deduce what the active toolchain is :|

    Maybe that should indicate the active toolchain as well.

  3. rami3l commented on Dec 28, 2024

    @rami3l
    MemberAuthor

    rustup toolchain list --verbose. This does give you the toolchain paths, but you have to manually deduce what the active toolchain is :|

    Maybe that should indicate the active toolchain as well.

    @ChrisDenton That's a description of the pre-v1.28 behavior. It's been fixed now.

  4. rami3l commented on Dec 29, 2024

    @rami3l
    MemberAuthor

    I think maybe with --verbose would be better? I worry that people are parsing rustup show active-toolchain so changing it might break scripts, etc.

    @ChrisDenton That compatibility, if it exists in the first place, is unfortunately already broken since #3225, so essentially this is a similar situation to #4045.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions