rust/library/compiler-builtins/libm/ci/download-musl.sh
Trevor Gross 6ac9c14933 Add a retry to the musl download
This download has occasionally been failing in CI recently. Add a retry
so this is less likely to cause the workflow to fail.
2025-01-21 22:02:48 -05:00

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"