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

rust-toolchain.toml causes 'cargo' component, is not applicable #1009

Closed
cataggar opened this issue Aug 15, 2022 · 12 comments
Closed

rust-toolchain.toml causes 'cargo' component, is not applicable #1009

cataggar opened this issue Aug 15, 2022 · 12 comments

Comments

@cataggar
Copy link
Member

cataggar commented Aug 15, 2022

rust-toolchain.toml from #1006 is causing an error when I try to run cargo:

PS C:\Users\cataggar\io\azure-sdk-for-rust> cargo check -p identity --examples
error: the 'cargo.exe' binary, normally provided by the 'cargo' component, is not applicable to the '1.63.0-x86_64-pc-windows-msvc' toolchain

PS C:\Users\cataggar\io\azure-sdk-for-rust> rustc --version
rustc 1.63.0 (4b91a6ea7 2022-08-08)

cc @gorzell

[toolchain]
channel = "1.63.0"
components = [ "rustfmt", "clippy" ]

@gorzell
Copy link
Contributor

gorzell commented Aug 15, 2022

Interesting, do you happen to not use rustup? That is the only thing I can think of that might cause issues, because I am pretty sure it expects to use rustup to manage everything. In fact this is explicitly a rustup feature.

@rylev
Copy link
Contributor

rylev commented Aug 15, 2022

I can confirm that on my Windows machine (where I do use rustup) that this works as expected. If it is the case that we require users to use rustup we should definitely document that. However, I'm not really convinced that the tradeoff is worth it. We upgrade to new toolchains very quickly, and we're really only saving users on old toolchains the hassle of being reminded to update their toolchain when CI fails.

@cataggar
Copy link
Member Author

I'm using rustup. I updated to 1.63.0 using rustup.

PS C:\Users\cataggar\io\azure-sdk-for-rust> cmd /c where rustup
C:\Users\cataggar\.cargo\bin\rustup.exe
PS C:\Users\cataggar\io\azure-sdk-for-rust> rustup --version
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.63.0 (4b91a6ea7 2022-08-08)`

@cataggar
Copy link
Member Author

@rylev, do you have rustup 1.25.1 on your Windows machine? rustup self update

@rylev
Copy link
Contributor

rylev commented Aug 15, 2022

I do indeed:

> rustup --version
rustup 1.25.1 (bb60b1e89 2022-07-12)

@rylev
Copy link
Contributor

rylev commented Aug 15, 2022

Found one issue online that seems to mirror what you're seeing here. The solution that seemed to work was to uninstall and reinstall the toolchain. That might be the easiest. The other option is building rustup locally and debugging it...

@cataggar
Copy link
Member Author

rust-lang/rustup#2704 has a similar error message, but was marked as a duplicate of rust-lang/rustup#988 . I removed all my toolchains with rustup toolchain remove and readded a couple. It is working now.

Here is my toolchain list before and after:

PS C:\Users\cataggar\io\azure-sdk-for-rust> rustup toolchain list
stable-x86_64-pc-windows-msvc (default)
nightly-x86_64-pc-windows-msvc
ms-1.58
1.63.0-x86_64-pc-windows-msvc (override)

PS C:\Users\cataggar\io\azure-sdk-for-rust> rustup toolchain list
stable-x86_64-pc-windows-msvc (default)
1.63.0-x86_64-pc-windows-msvc (override)

@cataggar
Copy link
Member Author

cataggar commented Oct 4, 2022

I had to reinstall the toolchains again to get this to work for me with 1.64. I got the same error as before.

@testingapisname
Copy link

testingapisname commented Oct 25, 2022

@cataggar I think I am running into the same issue you have here. I am a bit new to rust and trying to learn how to use this SDK.

PS D:\RustProjects\azure-sdk-for-rust> rustup toolchain list
stable-x86_64-pc-windows-msvc (default)
1.64.0-x86_64-pc-windows-msvc (override)

PS D:\RustProjects\azure-sdk-for-rust> rustup --version
rustup 1.25.1 (bb60b1e89 2022-07-12)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active rustc version is (rustc does not exist)

I think I have the same toolchain list as you but still cannot get this project to build

PS D:\RustProjects\azure-sdk-for-rust> cargo build
error: process didn't exit successfully: rustc -vV (exit code: 1)
--- stderr
error: the 'rustc.exe' binary, normally provided by the 'rustc' component, is not applicable to the '1.64.0-x86_64-pc-windows-msvc' toolchain

I am wondering what I am doing wrong. Any assistance would be greatly appreciated.

@rylev
Copy link
Contributor

rylev commented Oct 25, 2022

Can you run the following and try again?

rustup toolchain uninstall 1.64.0-x86_64-pc-windows-msvc
rustup toolchain install 1.64.0-x86_64-pc-windows-msvc

@testingapisname
Copy link

@rylev that got me working to get a build going.

Now just to figure out how to use the SDK :) Thanks for the assist!

@MrTact
Copy link

MrTact commented Jul 20, 2023

I think this happened to me just now (Intel Mac running macOS Ventura 13.4.1) because I had a network hiccup while installing the toolchain:

info: downloading component 'rust-docs'
info: retrying download for 'https://static.rust-lang.org/dist/2023-06-01/rust-docs-1.70.0-x86_64-apple-darwin.tar.xz'
warning: bad checksum for cached download
error: component download failed for rust-docs-x86_64-apple-darwin: could not rename downloaded file from '/Users/tkeating/.rustup/downloads/9c30ce1f6308a379e677021e00e18f185cc708b4edbddacd193f1fb3e0979c27.partial' to '/Users/tkeating/.rustup/downloads/9c30ce1f6308a379e677021e00e18f185cc708b4edbddacd193f1fb3e0979c27'

Nuking the toolchain and letting rustup reinstall it seems to have fixed the problem.

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