From 0be402785c513a4e8d4e633ffa0f89bde4904dea Mon Sep 17 00:00:00 2001 From: yourmoonlight Date: Mon, 17 Jun 2024 18:35:09 +0800 Subject: [PATCH] use dtolnay/rust-toolchain instead of actions-rs/toolchain (#1883) * use dtolnay/rust-toolchain instead of actions-rs/toolchain * keep rust-toolchain for dev_setup.sh * use rust-toolchain.toml instead of rust-toolchain --- .github/actions/rust-setup/action.yaml | 2 +- rust-toolchain | 1 - rust-toolchain.toml | 2 -- scripts/dev_setup.sh | 4 ++-- 4 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 rust-toolchain diff --git a/.github/actions/rust-setup/action.yaml b/.github/actions/rust-setup/action.yaml index b043f57867..3e6e1bd7b0 100644 --- a/.github/actions/rust-setup/action.yaml +++ b/.github/actions/rust-setup/action.yaml @@ -9,7 +9,7 @@ runs: - run: sudo apt-get update && sudo apt-get install build-essential ca-certificates clang curl git libpq-dev libssl-dev pkg-config lsof lld --no-install-recommends --assume-yes shell: bash - - uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # pin@v1 + - uses: dtolnay/rust-toolchain@1.77.2 with: override: true components: rustfmt, clippy diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 6cdeba3855..0000000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -1.77.2 \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 8c10d70dae..fb0f94604f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,2 @@ -#we keep the `rust-toolchain` and `rust-toolchain.yaml` -#because some tools dose not support rust-toolchain.yaml yet [toolchain] channel = "1.77.2" \ No newline at end of file diff --git a/scripts/dev_setup.sh b/scripts/dev_setup.sh index ed9cd17852..c206bf2882 100755 --- a/scripts/dev_setup.sh +++ b/scripts/dev_setup.sh @@ -753,7 +753,7 @@ if [[ "$INSTALL_BUILD_TOOLS" == "false" ]] && \ INSTALL_BUILD_TOOLS="true" fi -if [ ! -f rust-toolchain ]; then +if [ ! -f rust-toolchain.toml ]; then echo "Unknown location. Please run this from the RoochNetwork moveos repository. Abort." exit 1 fi @@ -837,7 +837,7 @@ if [[ "$INSTALL_BUILD_TOOLS" == "true" ]]; then install_lld install_rustup "$BATCH_MODE" - install_toolchain "$(cat ./rust-toolchain)" + install_toolchain "$(awk -F ' = ' '/^channel/ {gsub(/"/, "", $2); print $2}' ./rust-toolchain.toml | tr -d '\n')" install_rustup_components_and_nightly install_cargo_sort