|
5 | 5 |
|
6 | 6 | set -euxo pipefail |
7 | 7 |
|
8 | | -RUST_TOOLCHAIN="1.57.0" |
9 | | - |
10 | | -LLVM_BRANCH="swift-5.3.2-RELEASE" |
| 8 | +RUST_TOOLCHAIN="1.60.0" |
| 9 | + |
| 10 | +# Note(Daniel): the official tagged releases of that llvm fork are currently |
| 11 | +# lagging too much behind the official `llvm`, which makes them incompatible |
| 12 | +# with the LLVM API required to compile the Rust toolchain, at least as of 1.60. |
| 13 | +# So neither swift-5.6.1-RELEASE nor swift-5.7-DEVELOPMENT-SNAPSHOT-2022-04-12-a |
| 14 | +# |
| 15 | +# But the tip of `apple/llvm-project`'s is too advanced as well, so I've had |
| 16 | +# to find a "sweet spot" in between both. I guess a decent approach could be |
| 17 | +# to start at https://github.com/rust-lang/rust/blob/1.60.0/.gitmodules#L37, and |
| 18 | +# to find a commit in `apple/llvm-project` close to it (ideally containing it) |
| 19 | +LLVM_BRANCH=bda51ce411586a8c012623300d8598ce84fced53 |
11 | 20 |
|
12 | 21 | get_rust_commit_for_toolchain() ( |
13 | 22 | # Yields "" for a toolchain like `x.y.z`, and `mm-dd-yy` for `nightly-mm-dd-yy` |
14 | 23 | IF_NIGHTLY_DATE_STRIPPED=$(echo "${RUST_TOOLCHAIN}" | sed -n 's/^nightly-//p') |
15 | | - if [ -n "${IF_NIGHTLY_DATE_STRIPPED}" ]; then |
| 24 | + if [ -n "${IF_NIGHTLY_DATE_STRIPPED}" ]; then # `if let Some(nightly_date)` |
16 | 25 | curl "https://static.rust-lang.org/dist/${IF_NIGHTLY_DATE_STRIPPED}/channel-rust-nightly-git-commit-hash.txt" |
17 | 26 | else |
18 | 27 | echo "refs/tags/${RUST_TOOLCHAIN}" |
19 | 28 | fi |
20 | 29 | ) |
21 | 30 |
|
22 | 31 | # 2. Select the best branch, tag or commit hash from https://github.com/rust-lang/rust |
23 | | - |
| 32 | +# Thanks to `get_rust_commit_for_toolchain` helper, this should no longer need |
| 33 | +# to be manually done. |
24 | 34 | RUST_BRANCH="$(get_rust_commit_for_toolchain)" |
25 | 35 |
|
26 | 36 | # 3. Select a name for the toolchain you want to install as. The toolchain will be installed |
27 | 37 | # under $HOME/.rustup/toolchains/rust-$RUST_TOOLCHAIN |
28 | | - |
29 | 38 | RUST_TOOLCHAIN="ios-arm64-${RUST_TOOLCHAIN}" |
0 commit comments