Skip to content

rustup allows rustup toolchain link 'toolchain with spaces', then panics #3168

@jyn514

Description

@jyn514

Problem

; rustup toolchain link 'toolchain with spaces' ~/src/rust/build/x86_64-apple-darwin/stage0
; rustup toolchain list
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unexpected character in pre-release identifier")', src/utils/utils.rs:547:83
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
; rustc '+toolchain with spaces' --version
rustc 1.67.0-beta.3 (b364405cc 2022-12-27)

Steps

  1. rustup toolchain link 'toolchain with spaces' ~/src/rust/build/x86_64-apple-darwin/stage0
  2. rustup toolchain list

Possible Solution(s)

Either rustup should not allow creating a toolchain that has spaces in the name, or rustup shouldn't panic on encountering the name in toolchain list.

Notes

cc #3130

Rustup version

rustup 1.25.1 (bb60b1e89 2022-07-12)

Installed toolchains

; rustup show
Default host: x86_64-apple-darwin
rustup home:  /Users/jyn/.local/lib/rustup

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("unexpected character in pre-release identifier")', src/utils/utils.rs:547:83
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
; ls /Users/jyn/.local/lib/rustup/toolchains
1.65-x86_64-apple-darwin    stable-x86_64-apple-darwin
nightly-x86_64-apple-darwin toolchain with spaces

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions