-
Notifications
You must be signed in to change notification settings - Fork 565
[rust] - Introducing new options to install components #1404
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
Merged
AlvaroRausell
merged 8 commits into
devcontainers:main
from
Kaniska244:rust-add-component-new
Jul 10, 2025
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d337166
[rust] - Introducing new options to install components
Kaniska244 eaf5498
Fix for testing with rockylinux and addition in tests
Kaniska244 4b2afdd
Correcting based on review comments.
Kaniska244 f1ec1c5
Further changes in the input
Kaniska244 4fa9bcb
correcting code comment
Kaniska244 6e8a357
Correcting based on review comment
Kaniska244 f067f4c
Correcting based on review comment.
Kaniska244 7e7ad9e
To rerun the test
Kaniska244 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| # Optional: Import test library | ||
| source dev-container-features-test-lib | ||
|
|
||
| # Helper function to check component is installed | ||
| check_component_installed() { | ||
| local component=$1 | ||
| if rustup component list | grep -q "${component}.*installed"; then | ||
| return 0 # Component is installed (success) | ||
| else | ||
| return 1 # Component is not installed (failure) | ||
| fi | ||
| } | ||
|
|
||
| # Helper function to check component is NOT installed | ||
| check_component_not_installed() { | ||
| local component=$1 | ||
| if rustup component list | grep -q "${component}.*installed"; then | ||
| return 1 # Component is installed (failure) | ||
| else | ||
| return 0 # Component is not installed (success) | ||
| fi | ||
| } | ||
|
|
||
| # Definition specific tests | ||
| check "cargo version" cargo --version | ||
| check "rustc version" rustc --version | ||
| check "correct rust version" rustup target list | grep aarch64-unknown-linux-gnu | ||
|
|
||
| # Check that specified custom components are installed | ||
| check "rust-analyzer is installed" check_component_installed "rust-analyzer" | ||
| check "rust-src is installed" check_component_installed "rust-src" | ||
| check "rustfmt is installed" check_component_installed "rustfmt" | ||
|
|
||
| # Check that clippy NOT installed | ||
| check "clippy not installed" check_component_not_installed "clippy" | ||
|
|
||
| # Report result | ||
| reportResults | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| # Optional: Import test library | ||
| source dev-container-features-test-lib | ||
|
|
||
| # Helper function to check component is installed | ||
| check_component_installed() { | ||
| local component=$1 | ||
| if rustup component list | grep -q "${component}.*installed"; then | ||
| return 0 # Component is installed (success) | ||
| else | ||
| return 1 # Component is not installed (failure) | ||
| fi | ||
| } | ||
|
|
||
| # Definition specific tests | ||
| check "cargo version" cargo --version | ||
| check "rustc version" rustc --version | ||
| check "correct rust version" rustup target list | grep aarch64-unknown-linux-gnu | ||
|
|
||
| # Check that default components are installed | ||
| check "rust-analyzer is installed" check_component_installed "rust-analyzer" | ||
| check "rust-src is installed" check_component_installed "rust-src" | ||
| check "rustfmt is installed" check_component_installed "rustfmt" | ||
| check "clippy is installed" check_component_installed "clippy" | ||
|
|
||
| # Report result | ||
| reportResults | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| # Optional: Import test library | ||
| source dev-container-features-test-lib | ||
|
|
||
| # Helper function to check component is installed | ||
| check_component_installed() { | ||
| local component=$1 | ||
| if rustup component list | grep -q "${component}.*installed"; then | ||
| return 0 # Component is installed (success) | ||
| else | ||
| return 1 # Component is not installed (failure) | ||
| fi | ||
| } | ||
|
|
||
| # Helper function to check component is NOT installed | ||
| check_component_not_installed() { | ||
| local component=$1 | ||
| if rustup component list | grep -q "${component}.*installed"; then | ||
| return 1 # Component is installed (failure) | ||
| else | ||
| return 0 # Component is not installed (success) | ||
| fi | ||
| } | ||
|
|
||
| # Definition specific tests | ||
| check "cargo version" cargo --version | ||
| check "rustc version" rustc --version | ||
| check "correct rust version" rustup target list | grep aarch64-unknown-linux-gnu | ||
|
|
||
| # Check that no additional components are installed when empty list is provided | ||
| # Only the basic rust toolchain should be available | ||
| check "basic rust toolchain" rustc --version | ||
|
|
||
| # Verify that default components are automatically installed | ||
| check "rust-analyzer is installed" check_component_installed "rust-analyzer" | ||
| check "rust-src is installed" check_component_installed "rust-src" | ||
| check "rustfmt is installed" check_component_installed "rustfmt" | ||
| check "clippy is installed" check_component_installed "clippy" | ||
|
|
||
| # Report result | ||
| reportResults | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
|
|
||
| # Optional: Import test library | ||
| source dev-container-features-test-lib | ||
|
|
||
| # Helper function to check component is installed | ||
| check_component_installed() { | ||
| local component=$1 | ||
| if rustup component list | grep -q "${component}.*installed"; then | ||
| return 0 # Component is installed (success) | ||
| else | ||
| return 1 # Component is not installed (failure) | ||
| fi | ||
| } | ||
|
|
||
| # Definition specific tests | ||
| check "cargo version" cargo --version | ||
| check "rustc version" rustc --version | ||
| check "correct rust version" rustup target list | grep aarch64-unknown-linux-gnu | ||
|
|
||
| # Check that all specified extended components are installed | ||
| check "rust-analyzer is installed" check_component_installed "rust-analyzer" | ||
| check "rust-src is installed" check_component_installed "rust-src" | ||
| check "rustfmt is installed" check_component_installed "rustfmt" | ||
| check "clippy is installed" check_component_installed "clippy" | ||
| check "rust-docs is installed" check_component_installed "rust-docs" | ||
|
|
||
| # Report result | ||
| reportResults | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.