diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3c466..5091e71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * Add new parameter `cache-directories` that is propagated to `Swatinem/rust-cache` (#44 by @pranc1ngpegasus) * Add new parameter `cache-key` that is propagated to `Swatinem/rust-cache` as `key` (#41 by @iainlane) +* Make rustup toolchain installation more robust in light of planned changes https://github.com/rust-lang/rustup/issues/3635 and https://github.com/rust-lang/rustup/pull/3985 ## [1.9.0] - 2024-06-08 diff --git a/action.yml b/action.yml index d842f6e..f6929f3 100644 --- a/action.yml +++ b/action.yml @@ -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