Skip to content

Commit 22c3b8e

Browse files
Merge pull request #19 from getditto/dhm/stable-toolchain
1.57.0 release
2 parents f673071 + 733659a commit 22c3b8e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

config.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,27 @@
33
# returned by the command below:
44
# $ xcrun -sdk iphoneos swiftc --version
55

6+
set -euxo pipefail
7+
8+
RUST_TOOLCHAIN="1.57.0"
9+
610
LLVM_BRANCH="swift-5.3.2-RELEASE"
711

12+
get_rust_commit_for_toolchain() (
13+
# Yields "" for a toolchain like `x.y.z`, and `mm-dd-yy` for `nightly-mm-dd-yy`
14+
IF_NIGHTLY_DATE_STRIPPED=$(echo "${RUST_TOOLCHAIN}" | sed -n 's/^nightly-//p')
15+
if [ -n "${IF_NIGHTLY_DATE_STRIPPED}" ]; then
16+
curl "https://static.rust-lang.org/dist/${IF_NIGHTLY_DATE_STRIPPED}/channel-rust-nightly-git-commit-hash.txt"
17+
else
18+
echo "refs/tags/${RUST_TOOLCHAIN}"
19+
fi
20+
)
21+
822
# 2. Select the best branch, tag or commit hash from https://github.com/rust-lang/rust
923

10-
RUST_BRANCH="003d8d3f56848b6f3833340e859b089a09aea36a" # 2021-10-05
24+
RUST_BRANCH="$(get_rust_commit_for_toolchain)"
1125

1226
# 3. Select a name for the toolchain you want to install as. The toolchain will be installed
1327
# under $HOME/.rustup/toolchains/rust-$RUST_TOOLCHAIN
1428

15-
RUST_TOOLCHAIN="ios-arm64-nightly-2021-10-05"
29+
RUST_TOOLCHAIN="ios-arm64-${RUST_TOOLCHAIN}"

0 commit comments

Comments
 (0)