Merge pull request #4852 from lzutao/cargo_install

rustup cargo install-upgrade
This commit is contained in:
Manish Goregaokar 2019-11-27 14:51:13 -08:00 committed by GitHub
commit 29777b5cc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 8 deletions

View File

@ -12,7 +12,7 @@ cache:
directories:
- $HOME/.cargo
before_cache:
- cargo install -Z install-upgrade cargo-cache --debug
- cargo install cargo-cache --debug
- find $HOME/.cargo/bin/ ! -type d -exec strip {} \;
- cargo cache --autoclean
@ -28,7 +28,7 @@ install:
- |
if [[ -z ${INTEGRATION} ]]; then
if ! rustup component add rustfmt; then
cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt
cargo install --git https://github.com/rust-lang/rustfmt --bin rustfmt
fi
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
. $HOME/.nvm/nvm.sh

View File

@ -18,7 +18,7 @@ cache:
- '%USERPROFILE%\.cargo'
# before cache
after_test:
- cargo install -Z install-upgrade cargo-cache --debug
- cargo install cargo-cache --debug
- cargo cache --autoclean
install:
@ -27,7 +27,7 @@ install:
- set PATH=%USERPROFILE%\.cargo\bin;%PATH%
- rustup component add rustfmt --toolchain nightly & exit 0 # Format test handles missing rustfmt
- del rust-toolchain
- cargo install -Z install-upgrade rustup-toolchain-install-master
- cargo install rustup-toolchain-install-master
- rustup-toolchain-install-master -f -n master -c rustc-dev
- rustup override set master
- rustc -V

View File

@ -5,14 +5,13 @@ set -e
cd "$(dirname "$0")"
ERRNO=0
RTIM_PATH=$(command -v rustup-toolchain-install-master) || ERRNO=$?
RTIM_PATH=$(command -v rustup-toolchain-install-master)
CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}
# Check if people also install RTIM in other locations beside
# ~/.cargo/bin
if [[ "$ERRNO" -ne 0 ]] || [[ "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then
cargo install -Z install-upgrade rustup-toolchain-install-master
if [[ "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then
cargo +nightly install rustup-toolchain-install-master
else
VERSION=$(rustup-toolchain-install-master -V | grep -o "[0-9.]*")
REMOTE=$(cargo search rustup-toolchain-install-master | grep -o "[0-9.]*")