From a18f5585d2a8074da1bcc9a6f30611fce774e06d Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 26 Jan 2020 06:35:05 +0100 Subject: [PATCH] Fix Rust installation on CI. --- ci/azure-install-rust.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/ci/azure-install-rust.yml b/ci/azure-install-rust.yml index d9202f53c..4a9619860 100644 --- a/ci/azure-install-rust.yml +++ b/ci/azure-install-rust.yml @@ -6,21 +6,26 @@ steps: if command -v rustup; then echo `command -v rustup` `rustup -V` already installed - rustup self update - elif [ "$AGENT_OS" = "Windows_NT" ]; then - curl -sSf -o rustup-init.exe https://win.rustup.rs - rustup-init.exe -y --default-toolchain $TOOLCHAIN - echo "##vso[task.prependpath]$USERPROFILE/.cargo/bin" + + if brew ls rustup &>/dev/null; then + brew upgrade rustup + else + rustup self update + fi else - curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $TOOLCHAIN + curl -sSL https://sh.rustup.rs | sh -s -- -y --default-toolchain="$TOOLCHAIN" --profile=minimal echo "##vso[task.prependpath]$HOME/.cargo/bin" fi displayName: Install rustup - bash: | set -euo pipefail - - rustup update $TOOLCHAIN + rustup set profile minimal + rustup component remove --toolchain=$TOOLCHAIN rust-docs || echo "already removed" + rustup update --no-self-update $TOOLCHAIN + if [ "$TOOLCHAIN" = "nightly" ]; then + rustup component add --toolchain=$TOOLCHAIN rustc-dev + fi rustup default $TOOLCHAIN displayName: Install rust