build: install zlib from alpine packages (#5317)

This commit is contained in:
Chongyi Zheng 2024-02-29 07:56:54 -05:00 committed by GitHub
parent e0fc164bba
commit 1eea6127e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,19 +2,6 @@
set -euo pipefail set -euo pipefail
case $TARGETARCH in
amd64)
target=x86_64
;;
arm64)
target=arm64
;;
*)
echo "$TARGETARCH is not supported"
exit 1
;;
esac
url=$( url=$(
set -euo pipefail set -euo pipefail
curl -s \ curl -s \
@ -31,14 +18,9 @@ apk add --no-cache --force-overwrite "glibc-${GLIBC_VERSION}.apk"
rm "glibc-${GLIBC_VERSION}.apk" rm "glibc-${GLIBC_VERSION}.apk"
# Install zlib # Install zlib
mkdir /tmp/libz
apk add --no-cache --virtual .glibc-build-deps \ apk add --no-cache --virtual .glibc-build-deps \
tar \ tar \
zlib \
zstd zstd
curl --retry 5 --retry-delay 5 -sL https://www.archlinux.org/packages/core/${target}/zlib/download | tar -x --zstd -C /tmp/libz
mv /tmp/libz/usr/lib/libz.so* /usr/glibc-compat/lib
rm -rf /tmp/libz
apk del --no-network --purge .glibc-build-deps apk del --no-network --purge .glibc-build-deps