You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cargo is not applicable when using a toolchain specified in rust-toolchain.toml #3104
❯ cargo install --path . --features=extra
error: the 'cargo' binary, normally provided by the 'cargo' component, is not applicable to the '1.64.0-aarch64-apple-darwin' toolchain
Strangely enough, if I change channel = "1.64.0" to channel = "1.64" it fixes the issue but breaks other platforms. It almost seems like there's a naming issue that got published.
Steps
Described above
Possible Solution(s)
It should be possible to use rust-toolchain.toml to request an earlier version of the Rust compiler using the full version number across platforms.
Notes
No response
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.64.0 (a55dd71d5 2022-09-19)`
I also encountered a similar problem, throughrustup uninstall nightly-aarch64-apple-darwin and rustup install nightly-aarch64-apple-darwin can solve the problem.
I guess because I need to switch between x86_64 and arm frequently, but CARGO_HOME uses the same.
It occurs when channel = "1.72". I solved it via setting channel = "1.72.0".
This may indicate a problem with the major.minor channel aliases. @pietroalbini I think you know about the setup of those? (If not, can you point me at the right place to enquire).
Looks like the problem is still there with the 1.79 channel (#3953)?
@jdno There shouldn't be a fundamental difference between the two manifests (1.79 and 1.79.0), right?
Update: Just tried on my own Mac and nothing happens:
> rustup --versionrustup 1.27.1+366 (4149df642 2024-07-15)info: This is the version for the rustup toolchain manager, not the rustc compiler.info: The currently active `rustc` version is `rustc 1.79.0 (129f3b996 2024-06-10)`
> rustup toolchain install 1.79info: syncing channel updates for '1.79-aarch64-apple-darwin'info: latest update on 2024-06-13, rust version 1.79.0 (129f3b996 2024-06-10)info: downloading component 'cargo' 6.4 MiB / 6.4 MiB (100 %) 1.2 MiB/s in 7s info: downloading component 'clippy' 2.2 MiB / 2.2 MiB (100 %) 622.8 KiB/s in 2s info: downloading component 'rust-docs' 15.4 MiB / 15.4 MiB (100 %) 5.2 MiB/s in 3s info: downloading component 'rust-std' 22.7 MiB / 22.7 MiB (100 %) 6.4 MiB/s in 4s info: downloading component 'rustc' 50.9 MiB / 50.9 MiB (100 %) 9.4 MiB/s in 7s info: downloading component 'rustfmt'info: installing component 'cargo'info: installing component 'clippy'info: installing component 'rust-docs' 15.4 MiB / 15.4 MiB (100 %) 3.8 MiB/s in 2s info: installing component 'rust-std' 22.7 MiB / 22.7 MiB (100 %) 20.0 MiB/s in 1s info: installing component 'rustc' 50.9 MiB / 50.9 MiB (100 %) 22.9 MiB/s in 2s info: installing component 'rustfmt' 1.79-aarch64-apple-darwin installed - rustc 1.79.0 (129f3b996 2024-06-10)info: self-update is disabled for this build of rustupinfo: any updates to rustup will need to be fetched with your system package manager
> rustup toolchain install 1.79.0info: syncing channel updates for '1.79.0-aarch64-apple-darwin'info: latest update on 2024-06-13, rust version 1.79.0 (129f3b996 2024-06-10)info: downloading component 'cargo' 6.4 MiB / 6.4 MiB (100 %) 3.0 MiB/s in 3s info: downloading component 'clippy' 2.2 MiB / 2.2 MiB (100 %) 751.4 KiB/s in 2s info: downloading component 'rust-docs' 15.4 MiB / 15.4 MiB (100 %) 1.1 MiB/s in 23s info: downloading component 'rust-std' 22.7 MiB / 22.7 MiB (100 %) 4.1 MiB/s in 7s info: downloading component 'rustc' 50.9 MiB / 50.9 MiB (100 %) 6.4 MiB/s in 10s info: downloading component 'rustfmt' 1.6 MiB / 1.6 MiB (100 %) 737.6 KiB/s in 2s info: installing component 'cargo'info: installing component 'clippy'info: installing component 'rust-docs' 15.4 MiB / 15.4 MiB (100 %) 4.0 MiB/s in 2s info: installing component 'rust-std' 22.7 MiB / 22.7 MiB (100 %) 21.1 MiB/s in 1s info: installing component 'rustc' 50.9 MiB / 50.9 MiB (100 %) 23.1 MiB/s in 2s info: installing component 'rustfmt' 1.79.0-aarch64-apple-darwin installed - rustc 1.79.0 (129f3b996 2024-06-10)info: self-update is disabled for this build of rustupinfo: any updates to rustup will need to be fetched with your system package manager
This could also be an error specific to toolchain files, but I doubt about it...
@Rigidity can you see your cargo under ~/.rustup/toolchains/*/bin for both versions? If so, that might indicate an internal error within Rustup. Thanks!
This is bizarre, I can't reproduce it no matter what I do now. I see cargo in both and it works with 1.79 in the toolchain now.
I tried reinstalling multiple times before and couldn't get anything to work, so this is pretty strange...
I'll let you know if I run into it again I guess
This is bizarre, I can't reproduce it no matter what I do now. I see cargo in both and it works with 1.79 in the toolchain now. I tried reinstalling multiple times before and couldn't get anything to work, so this is pretty strange... I'll let you know if I run into it again I guess
@Rigidity Thanks for letting me know! 👀 In that case I'll put this into #3937 then...
FWIW our mitigation in #3635, once completed, should address this problem for you for about 70% of the time.
I think it might be worth noting that the original issue also coincided with an error saying something like "Could not copy downloaded file to path " when I tried to (re)install 1.79 manually. I'm guessing that it was trying to download Cargo and since it already existed in the destination directory (maybe it was picking the wrong one out of the two?) it failed.
So could have been some sort of corruption or race condition.
changed the title [-]Cargo `is not applicable` to the `1.64.0` toolchain[/-][+]Cargo `is not applicable` when using a toolchain specified in `rust-toolchain.toml`[/+]on Jul 17, 2024
Activity
joii2020 commentedon Dec 14, 2022
I also encountered a similar problem, through
rustup uninstall nightly-aarch64-apple-darwinandrustup install nightly-aarch64-apple-darwincan solve the problem.I guess because I need to switch between x86_64 and arm frequently, but CARGO_HOME uses the same.
sambrightman commentedon Dec 22, 2022
Potentially some connection to #3061? Or at least the workaround seems connected.
L-M-Sherlock commentedon Aug 26, 2023
Same problem:
It occurs when channel = "1.72". I solved it via setting channel = "1.72.0".
rbtcollins commentedon Aug 28, 2023
This may indicate a problem with the major.minor channel aliases. @pietroalbini I think you know about the setup of those? (If not, can you point me at the right place to enquire).
ashsajal1 commentedon Feb 6, 2024
Use stable-gnu toolchain.
rustup toolchain install stable-gnuthen
rustup default stable-x86_64-pc-windows-gnuref : https://rust-lang.github.io/rustup/installation/windows.html
[-]Cargo via rustup + rust-toolchain broken on macOS[/-][+]Cargo `is not applicable` to the `1.64.0` toolchain[/+]rami3l commentedon Jul 17, 2024
Looks like the problem is still there with the 1.79 channel (#3953)?
@jdno There shouldn't be a fundamental difference between the two manifests (1.79 and 1.79.0), right?
Update: Just tried on my own Mac and nothing happens:
This could also be an error specific to toolchain files, but I doubt about it...
@Rigidity can you see your
cargounder~/.rustup/toolchains/*/binfor both versions? If so, that might indicate an internal error within Rustup. Thanks!Rigidity commentedon Jul 17, 2024
This is bizarre, I can't reproduce it no matter what I do now. I see
cargoin both and it works with1.79in the toolchain now.I tried reinstalling multiple times before and couldn't get anything to work, so this is pretty strange...
I'll let you know if I run into it again I guess
rami3l commentedon Jul 17, 2024
@Rigidity Thanks for letting me know! 👀 In that case I'll put this into #3937 then...
FWIW our mitigation in #3635, once completed, should address this problem for you for about 70% of the time.
Rigidity commentedon Jul 17, 2024
I think it might be worth noting that the original issue also coincided with an error saying something like "Could not copy downloaded file to path " when I tried to (re)install 1.79 manually. I'm guessing that it was trying to download Cargo and since it already existed in the destination directory (maybe it was picking the wrong one out of the two?) it failed.
So could have been some sort of corruption or race condition.
djc commentedon Jul 17, 2024
@rami3l could you give this issue a better title?
[-]Cargo `is not applicable` to the `1.64.0` toolchain[/-][+]Cargo `is not applicable` when using a toolchain specified in `rust-toolchain.toml`[/+]