Skip to content

rustup component list shows rust-std components it won't accept #3320

Description

@jyn514

Problem

; rustup component list | grep rust-std | head
rust-std-aarch64-apple-darwin
rust-std-aarch64-apple-ios
rust-std-aarch64-apple-ios-sim
rust-std-aarch64-linux-android
rust-std-aarch64-pc-windows-msvc
rust-std-aarch64-unknown-fuchsia
rust-std-aarch64-unknown-linux-gnu
rust-std-aarch64-unknown-linux-musl
rust-std-aarch64-unknown-none
rust-std-aarch64-unknown-none-softfloat
; rustup component add rust-std-aarch64-apple-darwin
error: toolchain 'nightly-x86_64-unknown-linux-gnu' does not contain component 'rust-std-aarch64-apple-darwin' for target 'x86_64-unknown-linux-gnu'
note: not all platforms have the standard library pre-compiled: https://doc.rust-lang.org/nightly/rustc/platform-support.html
help: consider using `cargo build -Z build-std` instead

This second error message is confusing and somewhat misleading. nightly does support aarch64-apple-darwin, but component doesn't know how to handle it, you need to use rustup target add instead.

Steps

  1. rustup component list

Possible Solution(s)

One or more of the following:

  1. Don't show components starting with rust-std in rustup target list
  2. Give a better error message when trying rustup component add rust-std-*, ideally suggesting rustup target add.

Notes

No response

Rustup version

rustup 1.26.0 (5af9b9484 2023-04-05)

Installed toolchains

; rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/jyn/.local/lib/rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
r2-stage1
r3-stage1
stage1

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.70.0-nightly (9df3a39fb 2023-04-11)

Activity

  1. jyn514 commented on Apr 12, 2023

    @jyn514
    MemberAuthor

    Ah, I see that rustup component add rust-std --target x86_64-apple-darwin does work. Maybe rustup component list should just format its output differently? Something like rust-std (target: aarch64-apple-darwin).

    Note that this also applies for the rustc-dev component, which can't be installed with target add and has to use component add --target.

  2. rami3l commented on Jun 9, 2024

    @rami3l
    Member

    Closing this as a duplicate of #3166, fixed in #3601:

    > rustup --version
    rustup 1.27.1+198 (81a71647f 2024-06-09)
    info: This is the version for the rustup toolchain manager, not the rustc compiler.
    info: The currently active `rustc` version is `rustc 1.78.0 (9b00956e5 2024-04-29)`
    > rustup component add rust-std-aarch64-apple-darwin
    info: component 'rust-std' for target 'aarch64-apple-darwin' is up to date
    > rustup component add rust-std-x86_64-apple-darwin
    info: downloading component 'rust-std' for 'x86_64-apple-darwin'
    info: installing component 'rust-std' for 'x86_64-apple-darwin'
     23.4 MiB /  23.4 MiB (100 %)  20.7 MiB/s in  1s
    > rustup component remove rust-std-x86_64-apple-darwin
    info: removing component 'rust-std' for 'x86_64-apple-darwin'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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