Skip to content

Commit 8718060

Browse files
authored
ci: binstall target for rust tools (#18615)
1 parent e433367 commit 8718060

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

scripts/setup/dev_setup.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -656,19 +656,26 @@ if [[ "$INSTALL_BUILD_TOOLS" == "true" ]]; then
656656

657657
# Any call to cargo will make rustup install the correct toolchain
658658
cargo version
659+
659660
## install cargo-binstall
660661
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
662+
663+
if [[ "$(uname)" == "Linux" ]]; then
664+
export CARGO_BUILD_TARGET="$(uname -m)-unknown-linux-musl"
665+
fi
661666
cargo binstall -y sccache
662667
cargo binstall -y cargo-zigbuild
663668
cargo binstall -y cargo-nextest
664-
665669
fi
666670

667671
if [[ "$INSTALL_CHECK_TOOLS" == "true" ]]; then
672+
if [[ "$(uname)" == "Linux" ]]; then
673+
# install musl target to avoid downloading the tools with incompatible GLIBC
674+
export CARGO_BUILD_TARGET="$(uname -m)-unknown-linux-musl"
675+
fi
668676
if [[ -f scripts/setup/rust-tools.txt ]]; then
669677
while read -r tool; do
670-
# Use cargo install to prevent downloading the tools with incompatible GLIBC
671-
cargo install "$tool"
678+
cargo binstall -y "$tool"
672679
done <scripts/setup/rust-tools.txt
673680
fi
674681

0 commit comments

Comments
 (0)