take rust version from toolchain file (#29320)

* take rust version from toolchain file

* add quotes to pacify shellcheck
This commit is contained in:
kirill lykov 2022-12-19 17:00:14 +01:00 committed by GitHub
parent a0b655b72b
commit cdb204114e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -10,7 +10,7 @@ if [[ -n $APPVEYOR ]]; then
appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
export USERPROFILE="D:\\"
./rustup-init -yv --default-toolchain $rust_stable --default-host x86_64-pc-windows-msvc
./rustup-init -yv --default-toolchain "$rust_stable" --default-host x86_64-pc-windows-msvc
export PATH="$PATH:/d/.cargo/bin"
rustc -vV
cargo -vV

View File

@ -18,7 +18,12 @@
if [[ -n $RUST_STABLE_VERSION ]]; then
stable_version="$RUST_STABLE_VERSION"
else
stable_version=1.65.0
# read rust version from rust-toolchain.toml file
base="$(dirname "${BASH_SOURCE[0]}")"
# pacify shellcheck: cannot follow dynamic path
# shellcheck disable=SC1090,SC1091
source "$base/../scripts/read-cargo-variable.sh"
stable_version=$(readCargoVariable channel "$base/../rust-toolchain.toml")
fi
if [[ -n $RUST_NIGHTLY_VERSION ]]; then

2
rust-toolchain.toml Normal file
View File

@ -0,0 +1,2 @@
[toolchain]
channel = "1.65.0"