Skip to content

rust: Fails since Rust 1.87.0 (2025-05-15) #1361

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

Open
liskin opened this issue May 15, 2025 · 3 comments · May be fixed by #1362
Open

rust: Fails since Rust 1.87.0 (2025-05-15) #1361

liskin opened this issue May 15, 2025 · 3 comments · May be fixed by #1362
Assignees

Comments

@liskin
Copy link

liskin commented May 15, 2025

Rust 1.87.0 has finally removed the long deprecated RLS (see also Previous Components), but the rust feature unfortunately installs that component unconditionally:

rustup component add rls rust-analysis rust-src rustfmt clippy 2>&1

This results in a build error:

#17 21.24 Installing common Rust dependencies...
#17 21.39 error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'rls' for target 'x86_64-unknown-linux-gnu'; did you mean 'rustc'?
#17 21.40 ERROR: Feature "Rust" (ghcr.io/devcontainers/features/rust) failed to install! Look at the documentation at ********/devcontainers/features/tree/main/src/rust for help troubleshooting this error.
#17 ERROR: process "/bin/sh -c cp -ar /tmp/build-features-src/rust_2 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/rust_2  && cd /tmp/dev-container-features/rust_2  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/rust_2" did not complete successfully: exit code: 1

and "This codespace is currently running in recovery mode due to a container error."

Can we please drop rls and rust-analysis from the rustup component add invocation?

liskin added a commit to liskin/features that referenced this issue May 15, 2025
Rust 1.87.0 and later have removed the long-deprecated RLS and rust-analysis
components. This change updates the install script to only add rust-src,
rustfmt, and clippy, preventing build errors during feature installation. See:
rust-lang/rust#126856
https://blog.rust-lang.org/2022/07/01/RLS-deprecation/
https://github.com/rust-lang/rustup/blob/a92432fc8b6d5d4e56ebd08ca1c45b7b1294c1bd/doc/user-guide/src/concepts/components.md#previous-components

Fixes: devcontainers#1361
@NeoScript
Copy link

I can second this. I was about to post an issue myself when I first saw this

This is my error log when trying to add the devcontainer feature to a python based devcontainer

[2025-05-15T22:54:47.556Z] 
46.02 Installing common Rust dependencies...
46.09 error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'rls' for target 'x86_64-unknown-linux-gnu'; did you mean 'rustc'?
46.10 ERROR: Feature "Rust" (ghcr.io/devcontainers/features/rust) failed to install! Look at the documentation at https://github.com/devcontainers/features/tree/main/src/rust for help troubleshooting this error.
[2025-05-15T22:54:47.556Z] ------
[2025-05-15T22:54:47.556Z] failed to solve: process "/bin/sh -c cp -ar /tmp/build-features-src/rust_4 /tmp/dev-container-features  && chmod -R 0755 /tmp/dev-container-features/rust_4  && cd /tmp/dev-container-features/rust_4  && chmod +x ./devcontainer-features-install.sh  && ./devcontainer-features-install.sh  && rm -rf /tmp/dev-container-features/rust_4" did not complete successfully: exit code: 1

I would recommend adding rust-analyzer as a replacement for rls. Additionally, perhaps we drop support for versions of rust older than 1.64 to prevent issues since rust-analyzer was released during 1.64

Sources:
https://doc.rust-lang.org/stable/releases.html#misc-6
rust-lang/rust#98640

@liskin
Copy link
Author

liskin commented May 16, 2025

I would recommend adding rust-analyzer as a replacement for rls.

I don't think this is necessary. VSCode downloads and uses its own copy of rust-analyzer. Not sure if enough people use emacs/neovim in a devcontainer/Codespaces to justify installing it using rustup as well.

(I mean, not that I really care… but if I were to add it I'd like to understand why I'm doing it.)

@KarstenB
Copy link

Just ran into this as well. I also think that most tools either install it themselves or don't use it. Complete removal is fine for me. Another option would be to add a components option and allow to override the components that are to be installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants