Skip to content

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

Closed as not planned
@jyn514

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)

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