Skip to content

Commit 5cbd749

Browse files
committed
chore: try to fix rustup issue
1 parent 4c0f33f commit 5cbd749

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ runs:
8181
- name: Install Rust Components
8282
run: |
8383
export active_rust_toolchain=$(rustup show active-toolchain | cut -d' ' -f1)
84+
# NOTE: Workaround for "error: failed to install component: 'rustfmt-preview-x86_64-unknown-linux-gnu', detected conflict: 'bin/cargo-fmt'"
85+
active_rust_bin_dir=$(dirname "$(rustup which rustc --toolchain "${active_rust_toolchain}")")
86+
87+
rm -f "${active_rust_bin_dir}/cargo-fmt"
88+
rm -f "${active_rust_bin_dir}/rustfmt"
89+
rm -f ~/.cargo/bin/cargo-fmt
90+
rm -f ~/.cargo/bin/rustfmt
91+
8492
rustup component add --toolchain ${active_rust_toolchain} rustfmt clippy
8593
shell: bash
8694

0 commit comments

Comments
 (0)