Skip to content

Commit fc49f9d

Browse files
kirill lykovilya-bobyr
authored andcommitted
take rust version from toolchain file (#29320)
* take rust version from toolchain file * add quotes to pacify shellcheck
1 parent 423bd02 commit fc49f9d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

ci/publish-tarball.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if [[ -n $APPVEYOR ]]; then
1010

1111
appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
1212
export USERPROFILE="D:\\"
13-
./rustup-init -yv --default-toolchain $rust_stable --default-host x86_64-pc-windows-msvc
13+
./rustup-init -yv --default-toolchain "$rust_stable" --default-host x86_64-pc-windows-msvc
1414
export PATH="$PATH:/d/.cargo/bin"
1515
rustc -vV
1616
cargo -vV

ci/rust-version.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
if [[ -n $RUST_STABLE_VERSION ]]; then
1919
stable_version="$RUST_STABLE_VERSION"
2020
else
21-
stable_version=1.65.0
21+
# read rust version from rust-toolchain.toml file
22+
base="$(dirname "${BASH_SOURCE[0]}")"
23+
# pacify shellcheck: cannot follow dynamic path
24+
# shellcheck disable=SC1090,SC1091
25+
source "$base/../scripts/read-cargo-variable.sh"
26+
stable_version=$(readCargoVariable channel "$base/../rust-toolchain.toml")
2227
fi
2328

2429
if [[ -n $RUST_NIGHTLY_VERSION ]]; then

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "1.65.0"

0 commit comments

Comments
 (0)