Skip to content

Commit

Permalink
build: do not reinstall master toolchain if it is up-to-date
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Oct 22, 2019
1 parent 1d0f625 commit f9d2a1f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions setup-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ set -e
cd "$(dirname "$0")"

if [[ "$CI" == true ]] || ! command -v rustup-toolchain-install-master > /dev/null; then
cargo install -Z install-upgrade rustup-toolchain-install-master --bin rustup-toolchain-install-master
cargo install -Z install-upgrade rustup-toolchain-install-master --bin rustup-toolchain-install-master
fi

rustup-toolchain-install-master -f -n master
RUST_COMMIT=$(git ls-remote https://github.com/rust-lang/rust master | awk '{print $1}')

if rustc +master -Vv 2>/dev/null | grep -q "$RUST_COMMIT"; then
exit 0
fi

rustup-toolchain-install-master -f -n master "$RUST_COMMIT"
rustup override set master

0 comments on commit f9d2a1f

Please sign in to comment.