rustup: `rust-toolchain.toml` is not used for `rustup toolchain install`

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 in rust-toolchain.toml:

56.30 error: "/root/.rustup/toolchains/nightly-2024-12-24-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/Cargo.lock" does not exist, unable to build with the standard library, try:
56.30         rustup component add rust-src --toolchain nightly-2024-12-24-x86_64-unknown-linux-gnu

Steps

  1. Have rust-toolchain.toml with components = ["rust-src"]
  2. Run 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 on rustup 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

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 9
  • Comments: 17 (12 by maintainers)

Most upvoted comments

ℹ I had the same kind of issue as the opener at the same time (in my case, it was about the clippy component instead of rust-src, but it was also about the rust-toolchain.toml file).

And I confirm, at least in my case, that the error is gone with the release of rustup 1.28.1, thanks for your time.

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 😅