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

cargo binary doesn't work with nightly-2022-07-10 specified in rust-toolchain.toml #3025

Closed
aminya opened this issue Jul 11, 2022 · 10 comments
Closed
Labels

Comments

@aminya
Copy link

aminya commented Jul 11, 2022

Problem

I used to specify the toolchain version that I want to use in rust-toolchain.toml, but recently I get an error like this when I try to use cargo

cargo
error: the 'cargo.exe' binary, normally provided by the 'cargo' component, is not applicable to the 'nightly-2022-07-10-x86_64-pc-windows-msvc' toolchain  

Steps

Create a rust-toolchain.toml file.

[toolchain]
channel = "nightly-2022-07-10"
components = [
  "cargo",
]

Install a nightly toolchain using rustup. Then try to run cargo in this workspace.

Possible Solution(s)

  • Removing rust-toolchain.toml
  • Changing nightly-2022-07-10 to nightly

Notes

No response

Rustup version

rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.64.0-nightly (6dba4ed21 2022-07-09)`

Installed toolchains

Default host: x86_64-pc-windows-msvc
rustup home:  C:\Users\aminy\.rustup

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

stable-x86_64-pc-windows-msvc
nightly-2022-07-10-x86_64-pc-windows-msvc (default)
nightly-x86_64-pc-windows-gnu
nightly-x86_64-pc-windows-msvc
1.62.0-x86_64-pc-windows-msvc

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

nightly-2022-07-10-x86_64-pc-windows-msvc (overridden by 'C:\...\rust-toolchain.toml')
rustc 1.64.0-nightly (6dba4ed21 2022-07-09)
> rustup component list
cargo-x86_64-pc-windows-msvc (installed)
...
@aminya aminya added the bug label Jul 11, 2022
@aminya
Copy link
Author

aminya commented Jul 11, 2022

Strangely enough, by uninstalling the nightly-2022-07-10-x86_64-pc-windows-msvc toolchain using rustup uninstall and trying again, now cargo works! There is definitely a bug somewhere in rustup.

@rbtcollins
Copy link
Contributor

I'm not familiar with the publishing process for the channels, but my hunch here is that cargo wasn't published or some such - though thats not entirely consistent with the output you've pasted.

@simbleau
Copy link

simbleau commented Jul 18, 2022

This has affected me as well (Ubuntu 22.04). Nightly doesn't build, but specific versions do, e.g. nightly-2022-07-15. Timeline matches up, too. I first experienced this a week ago and had to circumvent it.

@simbleau
Copy link

Strangely enough, by uninstalling the nightly-2022-07-10-x86_64-pc-windows-msvc toolchain using rustup uninstall and trying again, now cargo works! There is definitely a bug somewhere in rustup.

This worked for me. I suspect somewhere, someone pushed a bad version of nightly on the linux-gnu architecture, and the only solution was to do a complete uninstall and reinstall.

@byteZorvin
Copy link

Strangely enough, by uninstalling the nightly-2022-07-10-x86_64-pc-windows-msvc toolchain using rustup uninstall and trying again, now cargo works! There is definitely a bug somewhere in rustup.

I was having a different toolchain, but tried the same thing, of uninstalling and then reinstalling worked for me

@glihm
Copy link

glihm commented Apr 11, 2023

In my case, I had to run rustup self uninstall and full reinstall to have cargo working again.

@mbwilding
Copy link

I uninstalled the nightly toolchain, and reinstalled and it started to work, so can confirm OP is right.

@nurmohammed840
Copy link

Just rustup update nightly fixed this error for me

@lucas-cauhe
Copy link

I fixed this using cargo +nightly subcommand

@CisaSettle
Copy link

CisaSettle commented May 15, 2024

rustup uninstal

after updating the code from the master which was changed to
[toolchain]
channel = "nightly-2024-05-14"
I face the same problem, and I use uninstall and install fixed.

rustup uninstall nightly-2024-05-14
rustup install nightly-2024-05-14
cargo build # works

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

10 participants