Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit d9a284f

Browse files
authored
toolchain: Pin repo to 1.59.0 using rust-toolchain.toml (#3466)
1 parent 5050257 commit d9a284f

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

ci/read-cargo-variable.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# source this file
2+
3+
readCargoVariable() {
4+
declare variable="$1"
5+
declare Cargo_toml="$2"
6+
7+
while read -r name equals value _; do
8+
if [[ $name = "$variable" && $equals = = ]]; then
9+
echo "${value//\"/}"
10+
return
11+
fi
12+
done < <(cat "$Cargo_toml")
13+
echo "Unable to locate $variable in $Cargo_toml" 1>&2
14+
}

ci/rust-version.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
if [[ -n $RUST_STABLE_VERSION ]]; then
1919
stable_version="$RUST_STABLE_VERSION"
2020
else
21-
stable_version=1.59.0
21+
base="$(dirname "${BASH_SOURCE[0]}")"
22+
source "$base/read-cargo-variable.sh"
23+
stable_version=$(readCargoVariable channel "$base/../rust-toolchain.toml")
2224
fi
2325

2426
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.59.0"

0 commit comments

Comments
 (0)