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

Include toolchain specification in error message on missing component #9631

Closed
GreenPenguino opened this issue Jun 16, 2021 · 13 comments
Closed

Comments

@GreenPenguino
Copy link

Describe the problem you are trying to solve

I try to run an example from https://github.com/Rahix/avr-hal.

$ cargo +nightly-2021-01-07 run --example leonardo-blink
Output:

error: "/home/<redacted>/.rustup/toolchains/nightly-2021-01-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
        rustup component add rust-src

So I try the suggested fix:
$ rustup component add rust-src

Output:
info: component 'rust-src' is up to date

After a while I realised that the last command tries to install the component for the default toolchain instead of the nightly toolchain. This is the first time I use a toolchain other than the default, and therefore the first time I use rustup.

Entering the following command solved the issue:
$ rustup component add --toolchain nightly-2021-01-07 rust-src

Describe the solution you'd like

It would be much clearer to include the toolchain specification in the suggested command.

$ cargo +nightly-2021-01-07 run --example leonardo-blink

Desired output:

error: "/home/<redacted>/.rustup/toolchains/nightly-2021-01-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/Cargo.lock" does not exist, unable to build with the standard library, try:
        rustup component add --toolchain nightly-2021-01-07 rust-src
@kinnison
Copy link

I'm not certain but I think that error is not coming from Rustup but from Cargo. Certainly we'd never have a reason to mention Cargo.lock from the component.

@kinnison
Copy link

@ehuss is this Cargo?

@GreenPenguino
Copy link
Author

I think it is indeed Cargo. Could this issue be moved to the Cargo repository?

@kinnison
Copy link

We need to wait for a Cargo dev to agree, and then we can look to do so.

@ehuss
Copy link
Contributor

ehuss commented Jun 25, 2021

Yea, that is from cargo. It is probably pretty easy to include the toolchain in the suggestion.

@kinnison
Copy link

If RUSTUP_TOOLCHAIN is set in the environment you can use that to hint it @ehuss :D Are you able to migrate the issue to the cargo repo?

@kinnison
Copy link

Frankly I'd also soften it to "You can try running rustup ...." because if it's a custom toolchain it might fail.

@ehuss
Copy link
Contributor

ehuss commented Jun 25, 2021

Unfortunately I don't have write access here to transfer.

@kinnison
Copy link

Aah I think it needs someone from infra. @pietroalbini perhaps?

@Rustin170506
Copy link
Member

A PR is created to add this information.

@pietroalbini pietroalbini transferred this issue from rust-lang/rustup Jun 27, 2021
@pietroalbini
Copy link
Member

Transferred the issue to cargo.

@Rustin170506
Copy link
Member

@ehuss I think we can close it now. 😄

@ehuss
Copy link
Contributor

ehuss commented Jun 27, 2021

Yea, this was fixed by #9625, thanks!

@ehuss ehuss closed this as completed Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants