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

The error reading rustc version message could be improved #3607

Open
rustrust opened this issue Dec 28, 2023 · 5 comments
Open

The error reading rustc version message could be improved #3607

rustrust opened this issue Dec 28, 2023 · 5 comments
Milestone

Comments

@rustrust
Copy link

Problem

M1 macOS 12.4.1

> rustup update
info: syncing channel updates for 'stable-aarch64-apple-darwin'
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: syncing channel updates for 'nightly-aarch64-apple-darwin'
info: checking for self-update

      stable-aarch64-apple-darwin unchanged - rustc 1.75.0 (82e1608df 2023-12-21)
  stable-x86_64-unknown-linux-gnu unchanged - (error reading rustc version)
     nightly-aarch64-apple-darwin unchanged - rustc 1.77.0-nightly (89e2160c4 2023-12-27)

Steps

rustup update with stable-x86_64-unknown-linux-gnu toolchain

Possible Solution(s)

No response

Notes

No response

Rustup version

rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.75.0 (82e1608df 2023-12-21)`


### Installed toolchains

```console
Default host: aarch64-apple-darwin
rustup home:  /Users/foobar/.rustup

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

stable-aarch64-apple-darwin (default)
stable-x86_64-unknown-linux-gnu
nightly-aarch64-apple-darwin
1.60.0-aarch64-apple-darwin
1.61.0-aarch64-apple-darwin
1.65.0-aarch64-apple-darwin
1.70.0-aarch64-apple-darwin

installed targets for active toolchain
--------------------------------------

aarch64-apple-darwin
aarch64-unknown-linux-gnu
x86_64-pc-windows-msvc

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

stable-aarch64-apple-darwin (default)
rustc 1.75.0 (82e1608df 2023-12-21)
@rustrust rustrust added the bug label Dec 28, 2023
@rami3l
Copy link
Member

rami3l commented Jan 2, 2024

@rustrust Thanks for filing this issue!

It seems that you're using Rust on macOS, so stable-x86_64-unknown-linux-gnu can't normally be a running host triple.
The error reading rustc version error indicates exactly that: rustup tries to run rustc to find out the exact version, but you cannot run x64 Linux binaries on ARM64 macOS.

Maybe you're setting up cross compilation? In that case, you should add a new target triple under your aarch64-apple-darwin toolchain, like you did with aarch64-unknown-linux-gnu.

Please feel free to tell me if have further concerns.
Have a nice day!

@rami3l rami3l closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
@rustrust
Copy link
Author

rustrust commented Jan 2, 2024

To prevent others from being perplexed by this in the future, maybe a different error message (one not using the word "error") might be helpful here?

@rami3l
Copy link
Member

rami3l commented Jan 2, 2024

@rustrust This error only indicates that rustup failed to invoke rustc, and no further info can be provided.

IRL this can happen for multiple reasons, e.g. the permission is not correct, the binary is corrupted, etc.

Although accidentally installing the binary built for another platform is indeed another possible reason, this particular situation should be quite rare IMHO.

Do you happen to have any specific error message in mind?

@djc
Copy link
Contributor

djc commented Jan 2, 2024

IRL this can happen for multiple reasons, e.g. the permission is not correct, the binary is corrupted, etc.

It would probably be helpful if we can propagate/show the exact error condition that triggered this.

@rami3l rami3l added this to the On Deck milestone Apr 15, 2024
@rami3l rami3l changed the title stable-x86_64-unknown-linux-gnu unchanged - (error reading rustc version) The error reading rustc version message could be improved Apr 15, 2024
@rami3l
Copy link
Member

rami3l commented Apr 15, 2024

Reopening since it's still valuable to enhance the error message.

@rami3l rami3l reopened this Apr 15, 2024
@rami3l rami3l modified the milestones: On Deck, 1.28.0 Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants