Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jyn514 opened this issue Apr 12, 2023 · 2 comments
Closed

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

jyn514 opened this issue Apr 12, 2023 · 2 comments
Labels

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 12, 2023

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)
@jyn514 jyn514 added the bug label Apr 12, 2023
@jyn514
Copy link
Member Author

jyn514 commented Apr 12, 2023

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.

@rami3l
Copy link
Member

rami3l commented Jun 9, 2024

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
Labels
Projects
None yet
Development

No branches or pull requests

2 participants