fix rust error when choose a non-default version. (#111)

port of https://github.com/microsoft/vscode-dev-containers/pull/1592
This commit is contained in:
Josh Spicer 2022-08-22 19:45:11 -04:00 committed by GitHub
parent ec1deb8280
commit 58e425039a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 9 deletions

View file

@ -1,6 +1,6 @@
{
"id": "rust",
"version": "1.0.2",
"version": "1.0.3",
"name": "Rust",
"description": "Installs Rust, common Rust utilities, and their required dependencies",
"options": {

View file

@ -179,8 +179,8 @@ else
apt-get -y install --no-install-recommends git
fi
echo ${RUST_VERSION} | grep -q "nightly"
is_nightly=$?
is_nightly=0
echo ${RUST_VERSION} | grep -q "nightly" || is_nightly=$?
if [ $is_nightly = 0 ]; then
check_nightly_version_formatting RUST_VERSION
else

View file

@ -0,0 +1,15 @@
#!/bin/bash
set -e
# Optional: Import test library
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
# Report result
reportResults

View file

@ -92,6 +92,14 @@
}
}
},
"rust_at_pinned_version": {
"image": "ubuntu:focal",
"features": {
"rust": {
"version": "1.62.0"
}
}
},
"install_cudnn_nvxt": {
"image": "debian",
"features": {