mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-03 14:34:58 +00:00
This download has occasionally been failing in CI recently. Add a retry so this is less likely to cause the workflow to fail.
25 lines
613 B
Bash
Executable File
25 lines
613 B
Bash
Executable File
#!/bin/sh
|
|
# Download the expected version of musl to a directory `musl`
|
|
|
|
set -eux
|
|
|
|
fname=musl-1.2.5.tar.gz
|
|
sha=a9a118bbe84d8764da0ea0d28b3ab3fae8477fc7e4085d90102b8596fc7c75e4
|
|
|
|
mkdir musl
|
|
curl -L "https://musl.libc.org/releases/$fname" -O --retry 5
|
|
|
|
case "$(uname -s)" in
|
|
MINGW*)
|
|
# Need to extract the second line because certutil does human output
|
|
fsha=$(certutil -hashfile "$fname" SHA256 | sed -n '2p')
|
|
[ "$sha" = "$fsha" ] || exit 1
|
|
;;
|
|
*)
|
|
echo "$sha $fname" | shasum -a 256 --check || exit 1
|
|
;;
|
|
esac
|
|
|
|
tar -xzf "$fname" -C musl --strip-components 1
|
|
rm "$fname"
|