Unverified Commit 94ed0bbb authored by Tomáš Janoušek's avatar Tomáš Janoušek Committed by GitHub

fix(rust): remove rls and rust-analysis for Rust 1.87+ compatibility (#1362)

* fix(rust): remove rls and rust-analysis for Rust 1.87+ compatibility

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:
https://github.com/rust-lang/rust/pull/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: https://github.com/devcontainers/features/issues/1361

* Drop support for older rust version that do not have rust-analyzer

* Add rust-analyzer as replacement for rls

* Update devcontainer-feature version number

* Add proposed version options

* test(rust): Bump pinned rust version to one incl rust-analyzer

---------
Co-authored-by: 's avatarneoscript <neoscripting@gmail.com>
parent 4f8a62ac
{
"id": "rust",
"version": "1.3.2",
"version": "1.3.3",
"name": "Rust",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/rust",
"description": "Installs Rust, common Rust utilities, and their required dependencies",
......@@ -10,6 +10,14 @@
"proposals": [
"latest",
"none",
"1.87",
"1.86",
"1.85",
"1.84",
"1.83",
"1.82",
"1.81",
"1.80",
"1.79",
"1.78",
"1.77",
......@@ -25,10 +33,7 @@
"1.67",
"1.66",
"1.65",
"1.64",
"1.63",
"1.62",
"1.61"
"1.64"
],
"default": "latest",
"description": "Select or enter a version of Rust to install."
......
......@@ -203,7 +203,7 @@ if [ "${UPDATE_RUST}" = "true" ]; then
rustup update 2>&1
fi
echo "Installing common Rust dependencies..."
rustup component add rls rust-analysis rust-src rustfmt clippy 2>&1
rustup component add rust-analyzer rust-src rustfmt clippy 2>&1
if [ -n "${RUSTUP_TARGETS}" ]; then
IFS=',' read -ra targets <<< "${RUSTUP_TARGETS}"
......
......@@ -8,7 +8,7 @@ source dev-container-features-test-lib
# Definition specific tests
check "cargo version" cargo --version
check "rustc version" rustc --version
check "correct rust version" rustc --version | grep 1.62.0
check "correct rust version" rustc --version | grep 1.64.0
# Report result
......
......@@ -3,7 +3,7 @@
"image": "ubuntu:focal",
"features": {
"rust": {
"version": "1.62.0"
"version": "1.64.0"
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment