Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,17 @@ export CARGO_NET_GIT_FETCH_WITH_CLI=true

# install rustup and stable Rust if needed
if command -v rustup &>/dev/null ; then
# uninstall to avoid file corruption
rustup uninstall stable && rustup install stable
# 1. rustup early than 1.28 fails with `rustup toolchain install`
# due to parameter mismatch. So self update first.
# 2. uninstall to avoid file corruption
rustup self update && rustup uninstall stable && rustup install stable
else
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
fi

# Ensure the toolchain, components, and targets we've specified in
# rust-toolchain.toml are ready to go. Since that file sets rustup's default
# toolchain for the entire directory, all we need to do is run any
# rustup-wrapped command to trigger installation. We've arbitrarily chosen
# "cargo --version" since it has no other effect.
cargo --version >/dev/null
# install the Rust toolchain set in rust-toolchain.toml
rustup toolchain install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should notice that this command requires higher version of rustup.

With rustup 1.27.1 (54dd3d00f 2024-04-24):
image

With rustup 1.28.0 (6e19fbec7 2025-03-02)
image

According to this, developers can use rustup self update to update the version of rustup.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
rustup 1.28.0 was released 2 days ago, I think most of the developers still keeps on rustup 1.27.1,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about change line32 to:
rustup self update && rustup uninstall stable && rustup install stable?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about change line32 to: rustup self update && rustup uninstall stable && rustup install stable?

Good catch, it is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


##########################################
# install toolchain
Expand Down