Skip to content

Commit 648cace

Browse files
committed
Use the new component dependency option of the rust-toolchain file
1 parent 41047de commit 648cace

File tree

6 files changed

+7
-4
lines changed

6 files changed

+7
-4
lines changed

.github/workflows/bootstrap_rustc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
run: |
3535
git config --global user.email "[email protected]"
3636
git config --global user.name "User"
37+
rustup self update
3738
./prepare.sh
3839
3940
- name: Test

.github/workflows/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
run: |
4141
git config --global user.email "[email protected]"
4242
git config --global user.name "User"
43+
rustup self update
4344
./prepare.sh
4445
4546
- name: Test

prepare.sh

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash --verbose
22
set -e
33

4-
rustup component add rust-src rustc-dev llvm-tools-preview
54
./build_sysroot/prepare_sysroot_src.sh
65
cargo install hyperfine || echo "Skipping hyperfine install"
76

rust-toolchain

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
nightly-2020-11-21
1+
[toolchain]
2+
channel = "nightly-2020-11-21"
3+
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

scripts/cargo.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dir=$(dirname "$0")
44
source "$dir/config.sh"
55

66
# read nightly compiler from rust-toolchain file
7-
TOOLCHAIN=$(cat "$dir/rust-toolchain")
7+
TOOLCHAIN=$(cat "$dir/rust-toolchain" | grep channel | sed "s/channel = \"\(.*\)\"/\1/")
88

99
cmd=$1
1010
shift || true

scripts/rustup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ case $1 in
88

99
echo "=> Installing new nightly"
1010
rustup toolchain install --profile minimal "nightly-${TOOLCHAIN}" # Sanity check to see if the nightly exists
11-
echo "nightly-${TOOLCHAIN}" > rust-toolchain
11+
sed -i "s/\"nightly-.*\"/\"nightly-${TOOLCHAIN}\"/" rust-toolchain
1212
rustup component add rustfmt || true
1313

1414
echo "=> Uninstalling all old nighlies"

0 commit comments

Comments
 (0)