2 # Set up the appropriate rustc toolchain
8 RTIM_PATH=$(command -v rustup-toolchain-install-master) || INSTALLED=false
9 CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}
11 # Check if RTIM is not installed or installed in other locations not in ~/.cargo/bin
12 if [[ "$INSTALLED" == false || "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then
13 cargo +nightly install rustup-toolchain-install-master
15 VERSION=$(rustup-toolchain-install-master -V | grep -o "[0-9.]*")
16 REMOTE=$(cargo +nightly search rustup-toolchain-install-master | grep -o "[0-9.]*")
17 echo "info: skipping updating rustup-toolchain-install-master at $RTIM_PATH"
18 echo " current version : $VERSION"
19 echo " remote version : $REMOTE"
22 RUST_COMMIT=$(git ls-remote https://github.com/rust-lang/rust master | awk '{print $1}')
24 if rustc +master -Vv 2>/dev/null | grep -q "$RUST_COMMIT"; then
25 echo "info: master toolchain is up-to-date"
29 if [[ -n "$HOST_TOOLCHAIN" ]]; then
30 TOOLCHAIN=('--host' "$HOST_TOOLCHAIN")
35 rustup-toolchain-install-master -f -n master "${TOOLCHAIN[@]}" -c rustc-dev -c llvm-tools -- "$RUST_COMMIT"
36 rustup override set master