Skip to content

Commit 0515464

Browse files
committed
build: do not reinstall master toolchain if it is up-to-date
1 parent 1d0f625 commit 0515464

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

setup-toolchain.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,11 @@ if [[ "$CI" == true ]] || ! command -v rustup-toolchain-install-master > /dev/nu
99
cargo install -Z install-upgrade rustup-toolchain-install-master --bin rustup-toolchain-install-master
1010
fi
1111

12-
rustup-toolchain-install-master -f -n master
12+
RUST_COMMIT=$(git ls-remote https://github.com/rust-lang/rust master | awk '{print $1}')
13+
14+
if rustc +master -Vv 2>/dev/null | grep -q "$RUST_COMMIT"; then
15+
exit 0
16+
fi
17+
18+
rustup-toolchain-install-master -f -n master "$RUST_COMMIT"
1319
rustup override set master

0 commit comments

Comments
 (0)