Make toolchain install more robust

This commit is contained in:
Jonas Bushart 2024-09-20 00:39:06 +02:00
parent eb4a655afd
commit 86a2ce6673
2 changed files with 5 additions and 2 deletions

View file

@ -137,8 +137,10 @@ runs:
if [[ -z "$toolchain" && ( -f "rust-toolchain" || -f "rust-toolchain.toml" ) ]]
then
# Install the toolchain as specified in the file
# Might break at some point: https://github.com/rust-lang/rustup/issues/1397
rustup show
# rustup show is the old way that implicitly installed a toolchain
# rustup toolchain install is the new explicit way
# https://github.com/rust-lang/rustup/issues/3635#issuecomment-2343511297
rustup show active-toolchain || rustup toolchain install
if [[ -n $components ]]; then
rustup component add ${components//,/ }
fi