From c9e0f67a2a3a530fd7864539e8d61b22400d86cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Janou=C5=A1ek?= Date: Thu, 15 May 2025 23:02:17 +0000 Subject: [PATCH 1/6] 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 --- src/rust/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust/install.sh b/src/rust/install.sh index 1025e46bb..bdc65af4d 100755 --- a/src/rust/install.sh +++ b/src/rust/install.sh @@ -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-src rustfmt clippy 2>&1 if [ -n "${RUSTUP_TARGETS}" ]; then IFS=',' read -ra targets <<< "${RUSTUP_TARGETS}" From 73e8a08fbbc5bd9215dbf7ad3f706525db873909 Mon Sep 17 00:00:00 2001 From: neoscript Date: Thu, 15 May 2025 18:18:54 -0500 Subject: [PATCH 2/6] Drop support for older rust version that do not have rust-analyzer --- src/rust/devcontainer-feature.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/rust/devcontainer-feature.json b/src/rust/devcontainer-feature.json index 8ee423050..a10d499a9 100644 --- a/src/rust/devcontainer-feature.json +++ b/src/rust/devcontainer-feature.json @@ -25,10 +25,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." From 9b21e8c474d8808509616d6d7153e38f0a35234c Mon Sep 17 00:00:00 2001 From: neoscript Date: Thu, 15 May 2025 18:19:30 -0500 Subject: [PATCH 3/6] Add rust-analyzer as replacement for rls --- src/rust/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust/install.sh b/src/rust/install.sh index bdc65af4d..d89fbe492 100755 --- a/src/rust/install.sh +++ b/src/rust/install.sh @@ -203,7 +203,7 @@ if [ "${UPDATE_RUST}" = "true" ]; then rustup update 2>&1 fi echo "Installing common Rust dependencies..." -rustup component add 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}" From 4eedaf2aa3bd4f877711a7486d33bd7c485440a8 Mon Sep 17 00:00:00 2001 From: neoscript Date: Thu, 15 May 2025 18:37:02 -0500 Subject: [PATCH 4/6] Update devcontainer-feature version number --- src/rust/devcontainer-feature.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rust/devcontainer-feature.json b/src/rust/devcontainer-feature.json index a10d499a9..a7784bec4 100644 --- a/src/rust/devcontainer-feature.json +++ b/src/rust/devcontainer-feature.json @@ -1,6 +1,6 @@ { "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", From 5b0426315a846445d072ae6ea3ff0902c2bf58a3 Mon Sep 17 00:00:00 2001 From: neoscript Date: Thu, 15 May 2025 18:39:20 -0500 Subject: [PATCH 5/6] Add proposed version options --- src/rust/devcontainer-feature.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rust/devcontainer-feature.json b/src/rust/devcontainer-feature.json index a7784bec4..ae67e0bdc 100644 --- a/src/rust/devcontainer-feature.json +++ b/src/rust/devcontainer-feature.json @@ -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", From 0eb24764f1f3a87522353160b4bf6c9574cbeb13 Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Fri, 16 May 2025 15:06:30 +0100 Subject: [PATCH 6/6] test(rust): Bump pinned rust version to one incl rust-analyzer --- test/rust/rust_at_pinned_version.sh | 2 +- test/rust/scenarios.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/rust/rust_at_pinned_version.sh b/test/rust/rust_at_pinned_version.sh index 2954a7acb..e7adf7d1f 100644 --- a/test/rust/rust_at_pinned_version.sh +++ b/test/rust/rust_at_pinned_version.sh @@ -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 diff --git a/test/rust/scenarios.json b/test/rust/scenarios.json index de037cd29..c3466b29b 100644 --- a/test/rust/scenarios.json +++ b/test/rust/scenarios.json @@ -3,7 +3,7 @@ "image": "ubuntu:focal", "features": { "rust": { - "version": "1.62.0" + "version": "1.64.0" } } },