-
Notifications
You must be signed in to change notification settings - Fork 938
rust-toolchain.toml
is not used for rustup toolchain install
#4216
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
Comments
@nazar-pc Thanks for your report. However I did consider this case in my implementation and I have even written a test for it: rustup/tests/suite/cli_rustup.rs Lines 2163 to 2190 in 21d4b27
Would you mind sharing more about how this issue can be reproduced? |
@nazar-pc Looking at https://github.com/autonomys/subspace/pull/3412/files it seems to me that the problem is not about Anyway, I've not been able to reproduce this locally. It'd be great if you could provide me with some further hints! 🙇 BTW @Kobzol are you having the same problem on your side? |
I'm not sure what do you mean by "on my side" :) |
@Kobzol Oh I just saw you hitting +1 on this problem, so I assume you might have relevant experience WRT this issue? Please don't mind me if I got it wrong... |
So we hit some issue after the rustup update with the Rust for Linux CI job, but it was something slightly different (something about the inability to pass arguments to custom/local toolchains). But I since removed rustup from our CI, since I realized it was not needed 😅 |
[toolchain]
channel = "nightly-2024-12-24"
components = ["rust-src"]
targets = ["wasm32-unknown-unknown"]
profile = "default" Then execute:
Next try to build with According to the logs above it was not being installed in 1.28.0. |
@nazar-pc I've spun up a new ARM64 Alpine container and I was not able to reproduce this: > printf '[toolchain]\nchannel = "nightly-2024-12-24"\ncomponents = ["rust-src"]\ntargets = ["wasm32-unknown-unknown"]
\nprofile = "default"' > rust-toolchain.toml
[..]
> apk add curl
[..]
> curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none
info: downloading installer
info: profile set to 'default'
info: default host triple is aarch64-unknown-linux-musl
info: skipping toolchain installation
Rust is installed now. Great!
To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).
To configure your current shell, you need to source
the corresponding env file under $HOME/.cargo.
This is usually done by running one of the following (note the leading DOT):
. "$HOME/.cargo/env" # For sh/bash/zsh/ash/dash/pdksh
source "$HOME/.cargo/env.fish" # For fish
source "$HOME/.cargo/env.nu" # For nushell
> ~/.cargo/bin/rustup toolchain install
info: syncing channel updates for 'nightly-2024-12-24-aarch64-unknown-linux-musl'
info: latest update on 2024-12-24, rust version 1.85.0-nightly (bdc6b3de4 2024-12-23)
info: downloading component 'cargo'
8.5 MiB / 8.5 MiB (100 %) 1.3 MiB/s in 2s
info: downloading component 'clippy'
3.0 MiB / 3.0 MiB (100 %) 956.6 KiB/s in 4s
info: downloading component 'rust-docs'
16.7 MiB / 16.7 MiB (100 %) 3.6 MiB/s in 5s
info: downloading component 'rust-src'
info: downloading component 'rust-std'
26.7 MiB / 26.7 MiB (100 %) 4.1 MiB/s in 7s
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
19.3 MiB / 19.3 MiB (100 %) 4.8 MiB/s in 6s
info: downloading component 'rustc'
85.2 MiB / 85.2 MiB (100 %) 4.1 MiB/s in 23s
info: downloading component 'rustfmt'
2.4 MiB / 2.4 MiB (100 %) 1.2 MiB/s in 2s
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
16.7 MiB / 16.7 MiB (100 %) 11.0 MiB/s in 1s
info: installing component 'rust-src'
info: installing component 'rust-std'
26.7 MiB / 26.7 MiB (100 %) 19.2 MiB/s in 1s
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
19.3 MiB / 19.3 MiB (100 %) 19.3 MiB/s in 1s
info: installing component 'rustc'
85.2 MiB / 85.2 MiB (100 %) 19.5 MiB/s in 4s
info: installing component 'rustfmt'
info: the active toolchain `nightly-2024-12-24-aarch64-unknown-linux-musl` has been installed
info: it's active because: overridden by '/rust-toolchain.toml' After all this maneuver, the file that you are asking for is in place: > ~/.cargo/bin/rustup component list --installed
cargo-aarch64-unknown-linux-musl
clippy-aarch64-unknown-linux-musl
rust-docs-aarch64-unknown-linux-musl
rust-src
rust-std-aarch64-unknown-linux-musl
rust-std-wasm32-unknown-unknown
rustc-aarch64-unknown-linux-musl
rustfmt-aarch64-unknown-linux-musl
> ls -lah ~/.rustup/toolchains/nightly-2024-12-24-aarch64-unknown-linux-musl/lib/rustlib/src/rust/library/
total 96K
drwxr-xr-x 20 root root 4.0K Mar 9 01:06 .
drwxr-xr-x 4 root root 4.0K Mar 9 01:06 ..
-rw-r--r-- 1 root root 11.2K Mar 9 01:06 Cargo.lock
-rw-r--r-- 1 root root 1.6K Mar 9 01:06 Cargo.toml
drwxr-xr-x 5 root root 4.0K Mar 9 01:06 alloc
drwxr-xr-x 8 root root 4.0K Mar 9 01:06 backtrace
drwxr-xr-x 5 root root 4.0K Mar 9 01:06 core
drwxr-xr-x 3 root root 4.0K Mar 9 01:06 panic_abort
drwxr-xr-x 3 root root 4.0K Mar 9 01:06 panic_unwind
drwxr-xr-x 4 root root 4.0K Mar 9 01:06 portable-simd
drwxr-xr-x 3 root root 4.0K Mar 9 01:06 proc_macro
drwxr-xr-x 3 root root 4.0K Mar 9 01:06 profiler_builtins
drwxr-xr-x 2 root root 4.0K Mar 9 01:06 rtstartup
drwxr-xr-x 2 root root 4.0K Mar 9 01:06 rustc-std-workspace-alloc
drwxr-xr-x 2 root root 4.0K Mar 9 01:06 rustc-std-workspace-core
drwxr-xr-x 2 root root 4.0K Mar 9 01:06 rustc-std-workspace-std
drwxr-xr-x 5 root root 4.0K Mar 9 01:06 std
drwxr-xr-x 7 root root 4.0K Mar 9 01:06 stdarch
drwxr-xr-x 3 root root 4.0K Mar 9 01:06 sysroot
drwxr-xr-x 3 root root 4.0K Mar 9 01:06 test
drwxr-xr-x 3 root root 4.0K Mar 9 01:06 unwind
drwxr-xr-x 3 root root 4.0K Mar 9 01:06 windows_targets |
Well, that was not the behavior as of 1.28.0, maybe you need |
@nazar-pc I wrote that logic and I believe there hasn't been that much of a logic change in terms of active toolchain detection, only installation. But anyway below is a retry with > ~/.cargo/bin/rustup toolchain uninstall nightly-2024-12-24
warn: removing the active toolchain; a toolchain override will be required for running Rust tools
info: uninstalling toolchain 'nightly-2024-12-24-aarch64-unknown-linux-musl'
info: toolchain 'nightly-2024-12-24-aarch64-unknown-linux-musl' uninstalled
> RUSTUP_AUTO_INSTALL=0 ~/.cargo/bin/rustup toolchain install
info: syncing channel updates for 'nightly-2024-12-24-aarch64-unknown-linux-musl'
info: latest update on 2024-12-24, rust version 1.85.0-nightly (bdc6b3de4 2024-12-23)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-src'
info: downloading component 'rust-std'
26.7 MiB / 26.7 MiB (100 %) 18.4 MiB/s in 1s
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
19.3 MiB / 19.3 MiB (100 %) 17.9 MiB/s in 1s
info: downloading component 'rustc'
85.2 MiB / 85.2 MiB (100 %) 13.4 MiB/s in 6s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
16.7 MiB / 16.7 MiB (100 %) 12.8 MiB/s in 1s
info: installing component 'rust-src'
info: installing component 'rust-std'
26.7 MiB / 26.7 MiB (100 %) 19.7 MiB/s in 1s
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rustc'
85.2 MiB / 85.2 MiB (100 %) 20.4 MiB/s in 4s
info: installing component 'rustfmt'
info: the active toolchain `nightly-2024-12-24-aarch64-unknown-linux-musl` has been installed
info: it's active because: overridden by '/rust-toolchain.toml'
> ls -lah ~/.rustup/toolchains/nightly-2024-12-24-aarch64-unknown-linux-musl/lib/rustlib/src/rust/library/
total 96K
drwxr-xr-x 20 root root 4.0K Mar 9 01:16 .
drwxr-xr-x 4 root root 4.0K Mar 9 01:16 ..
-rw-r--r-- 1 root root 11.2K Mar 9 01:16 Cargo.lock
-rw-r--r-- 1 root root 1.6K Mar 9 01:16 Cargo.toml
drwxr-xr-x 5 root root 4.0K Mar 9 01:16 alloc
drwxr-xr-x 8 root root 4.0K Mar 9 01:16 backtrace
drwxr-xr-x 5 root root 4.0K Mar 9 01:16 core
drwxr-xr-x 3 root root 4.0K Mar 9 01:16 panic_abort
drwxr-xr-x 3 root root 4.0K Mar 9 01:16 panic_unwind
drwxr-xr-x 4 root root 4.0K Mar 9 01:16 portable-simd
drwxr-xr-x 3 root root 4.0K Mar 9 01:16 proc_macro
drwxr-xr-x 3 root root 4.0K Mar 9 01:16 profiler_builtins
drwxr-xr-x 2 root root 4.0K Mar 9 01:16 rtstartup
drwxr-xr-x 2 root root 4.0K Mar 9 01:16 rustc-std-workspace-alloc
drwxr-xr-x 2 root root 4.0K Mar 9 01:16 rustc-std-workspace-core
drwxr-xr-x 2 root root 4.0K Mar 9 01:16 rustc-std-workspace-std
drwxr-xr-x 5 root root 4.0K Mar 9 01:16 std
drwxr-xr-x 7 root root 4.0K Mar 9 01:16 stdarch
drwxr-xr-x 3 root root 4.0K Mar 9 01:16 sysroot
drwxr-xr-x 3 root root 4.0K Mar 9 01:16 test
drwxr-xr-x 3 root root 4.0K Mar 9 01:16 unwind
drwxr-xr-x 3 root root 4.0K Mar 9 01:16 windows_targets |
I wish there was an easy way to retry 1.28.0 specifically. But if it is no longer an issue - great! |
@nazar-pc I cannot reproduce this with 1.28.0 either: > ~/.cargo/bin/rustup self uninstall
[..]
Thanks for hacking in Rust!
This will uninstall all Rust toolchains and data, and remove
$HOME/.cargo/bin from your PATH environment variable.
Continue? (y/N) y
info: removing rustup home
info: removing cargo home
info: removing rustup binaries
info: rustup is uninstalled
> curl -sSf https://static.rust-lang.org/rustup/archive/1.28.0/aarch64-unknown-linux-musl/rustup-init > rustup-init && chmod +x ./rustup-init
[..]
> ./rustup-init -y --default-toolchain none
info: profile set to 'default'
info: default host triple is aarch64-unknown-linux-musl
info: skipping toolchain installation
Rust is installed now. Great!
To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).
To configure your current shell, you need to source
the corresponding env file under $HOME/.cargo.
This is usually done by running one of the following (note the leading DOT):
. "$HOME/.cargo/env" # For sh/bash/zsh/ash/dash/pdksh
source "$HOME/.cargo/env.fish" # For fish
source "$HOME/.cargo/env.nu" # For nushell
> ~/.cargo/bin/rustup --version
rustup 1.28.0 (6e19fbec7 2025-03-02)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `(error reading rustc version)`
> ~/.cargo/bin/rustup toolchain install
info: syncing channel updates for 'nightly-2024-12-24-aarch64-unknown-linux-musl'
info: latest update on 2024-12-24, rust version 1.85.0-nightly (bdc6b3de4 2024-12-23)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
16.7 MiB / 16.7 MiB (100 %) 16.0 MiB/s in 1s
info: downloading component 'rust-src'
info: downloading component 'rust-std'
26.7 MiB / 26.7 MiB (100 %) 12.2 MiB/s in 2s
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
19.3 MiB / 19.3 MiB (100 %) 12.6 MiB/s in 1s
info: downloading component 'rustc'
85.2 MiB / 85.2 MiB (100 %) 12.5 MiB/s in 7s
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
16.7 MiB / 16.7 MiB (100 %) 11.5 MiB/s in 1s
info: installing component 'rust-src'
info: installing component 'rust-std'
26.7 MiB / 26.7 MiB (100 %) 19.2 MiB/s in 1s
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rustc'
85.2 MiB / 85.2 MiB (100 %) 20.0 MiB/s in 4s
info: installing component 'rustfmt'
info: the active toolchain `nightly-2024-12-24-aarch64-unknown-linux-musl` has been installed
info: it's active because: overridden by '/rust-toolchain.toml' ... and here we are again: > ls -lah ~/.rustup/toolchains/nightly-2024-12-24-aarch64-unknown-linux-musl/lib/rustlib/src/rust/library/
total 96K
drwxr-xr-x 20 root root 4.0K Mar 9 01:28 .
drwxr-xr-x 4 root root 4.0K Mar 9 01:28 ..
-rw-r--r-- 1 root root 11.2K Mar 9 01:28 Cargo.lock
-rw-r--r-- 1 root root 1.6K Mar 9 01:28 Cargo.toml
drwxr-xr-x 5 root root 4.0K Mar 9 01:28 alloc
drwxr-xr-x 8 root root 4.0K Mar 9 01:28 backtrace
drwxr-xr-x 5 root root 4.0K Mar 9 01:28 core
drwxr-xr-x 3 root root 4.0K Mar 9 01:28 panic_abort
drwxr-xr-x 3 root root 4.0K Mar 9 01:28 panic_unwind
drwxr-xr-x 4 root root 4.0K Mar 9 01:28 portable-simd
drwxr-xr-x 3 root root 4.0K Mar 9 01:28 proc_macro
drwxr-xr-x 3 root root 4.0K Mar 9 01:28 profiler_builtins
drwxr-xr-x 2 root root 4.0K Mar 9 01:28 rtstartup
drwxr-xr-x 2 root root 4.0K Mar 9 01:28 rustc-std-workspace-alloc
drwxr-xr-x 2 root root 4.0K Mar 9 01:28 rustc-std-workspace-core
drwxr-xr-x 2 root root 4.0K Mar 9 01:28 rustc-std-workspace-std
drwxr-xr-x 5 root root 4.0K Mar 9 01:28 std
drwxr-xr-x 7 root root 4.0K Mar 9 01:28 stdarch
drwxr-xr-x 3 root root 4.0K Mar 9 01:28 sysroot
drwxr-xr-x 3 root root 4.0K Mar 9 01:28 test
drwxr-xr-x 3 root root 4.0K Mar 9 01:28 unwind
drwxr-xr-x 3 root root 4.0K Mar 9 01:28 windows_targets |
@nazar-pc I'm really sorry for your previous bad experience with rustup, but without a proper reproduction I'm afraid we cannot really proceed further with this one. As such, I'll be closing this issue for now. Please feel free to provide further information if you have encountered similar problems, and I'll be glad to reopen it! 🙇 |
@nazar-pc It occurred to me that it's probably not a cc @weihanglo for its probable |
This error message was certainly emitted from Cargo, though it needs the rust-src (the source code libstd) available to build std. I don't see anything wrong in Cargo here. Need a minimal complete verifiable example. |
ℹ I had the same kind of issue as the opener at the same time (in my case, it was about the And I confirm, at least in my case, that the error is gone with the release of |
@Oliboy50 Thanks for sharing your experience, however AFAIK nothing has changed in terms of toolchain installation across v1.28.0 and v1.28.1, so I'm not sure if the problem is really gone. Probably it's just delayed. |
I don't know... what I can tell is that |
Verification
Problem
Like many others, I hit an issue where things stopped working in CI because latest version of Rustup didn't install the toolchain implicitly anymore.
I reached out to
rustup toolchain install
, but looks like it is not exactly equivalent because it didn't install any components mentioned inrust-toolchain.toml
:Steps
rust-toolchain.toml
withcomponents = ["rust-src"]
rustup toolchain install
I expect for toolchain to be installed with all components and targets to be installed too.
Right now components and targets do not seem to be installed.
Possible Solution(s)
No response
Notes
It'd be amazing if I could also install rustup itself with
--default-toolchain none
and simply rely onrustup toolchain install
so I don't have to duplicate the version in multiple places of the project.Rustup version
rustup 1.28.0 (6e19fbec7 2025-03-02)
Installed toolchains
-
OS version
Ubuntu 24.04
The text was updated successfully, but these errors were encountered: