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", "id": "rust",
"version": "1.3.2", "version": "1.3.3",
"name": "Rust", "name": "Rust",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/rust", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/rust",
"description": "Installs Rust, common Rust utilities, and their required dependencies", "description": "Installs Rust, common Rust utilities, and their required dependencies",
...@@ -10,6 +10,14 @@ ...@@ -10,6 +10,14 @@
"proposals": [ "proposals": [
"latest", "latest",
"none", "none",
"1.87",
"1.86",
"1.85",
"1.84",
"1.83",
"1.82",
"1.81",
"1.80",
"1.79", "1.79",
"1.78", "1.78",
"1.77", "1.77",
...@@ -25,10 +33,7 @@ ...@@ -25,10 +33,7 @@
"1.67", "1.67",
"1.66", "1.66",
"1.65", "1.65",
"1.64", "1.64"
"1.63",
"1.62",
"1.61"
], ],
"default": "latest", "default": "latest",
"description": "Select or enter a version of Rust to install." "description": "Select or enter a version of Rust to install."
......
...@@ -203,7 +203,7 @@ if [ "${UPDATE_RUST}" = "true" ]; then ...@@ -203,7 +203,7 @@ if [ "${UPDATE_RUST}" = "true" ]; then
rustup update 2>&1 rustup update 2>&1
fi fi
echo "Installing common Rust dependencies..." 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 if [ -n "${RUSTUP_TARGETS}" ]; then
IFS=',' read -ra targets <<< "${RUSTUP_TARGETS}" IFS=',' read -ra targets <<< "${RUSTUP_TARGETS}"
......
...@@ -8,7 +8,7 @@ source dev-container-features-test-lib ...@@ -8,7 +8,7 @@ source dev-container-features-test-lib
# Definition specific tests # Definition specific tests
check "cargo version" cargo --version check "cargo version" cargo --version
check "rustc version" rustc --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 # Report result
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"image": "ubuntu:focal", "image": "ubuntu:focal",
"features": { "features": {
"rust": { "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