From 341a4863fabe8c67b1b72c6d3183ee824878f950 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 27 Nov 2020 16:52:17 +0100 Subject: [PATCH] Use the new component dependency option of the rust-toolchain file (take 2) --- prepare.sh | 1 - rust-toolchain | 4 +++- scripts/cargo.sh | 2 +- scripts/rustup.sh | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/prepare.sh b/prepare.sh index ee995ffcfa9..64c097261c9 100755 --- a/prepare.sh +++ b/prepare.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash set -e -rustup component add rust-src rustc-dev llvm-tools-preview ./build_sysroot/prepare_sysroot_src.sh cargo install hyperfine || echo "Skipping hyperfine install" diff --git a/rust-toolchain b/rust-toolchain index 908ca52135b..495d8ea7734 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1,3 @@ -nightly-2021-03-05 +[toolchain] +channel = "nightly-2021-03-05" +components = ["rust-src", "rustc-dev", "llvm-tools-preview"] diff --git a/scripts/cargo.sh b/scripts/cargo.sh index 669d2d45b71..1daa5a78f7b 100755 --- a/scripts/cargo.sh +++ b/scripts/cargo.sh @@ -4,7 +4,7 @@ dir=$(dirname "$0") source "$dir/config.sh" # read nightly compiler from rust-toolchain file -TOOLCHAIN=$(cat "$dir/rust-toolchain") +TOOLCHAIN=$(cat "$dir/rust-toolchain" | grep channel | sed "s/channel = \"\(.*\)\"/\1/") cmd=$1 shift || true diff --git a/scripts/rustup.sh b/scripts/rustup.sh index 694945a87c2..fa7557653d8 100755 --- a/scripts/rustup.sh +++ b/scripts/rustup.sh @@ -8,7 +8,7 @@ case $1 in echo "=> Installing new nightly" rustup toolchain install --profile minimal "nightly-${TOOLCHAIN}" # Sanity check to see if the nightly exists - echo "nightly-${TOOLCHAIN}" > rust-toolchain + sed -i "s/\"nightly-.*\"/\"nightly-${TOOLCHAIN}\"/" rust-toolchain rustup component add rustfmt || true echo "=> Uninstalling all old nighlies"