mirror of
https://github.com/kirbylink/mpv-natives
synced 2026-11-19 09:14:39 +01:00
build: harden dependency downloads against transient mirror failures
wget now retries 3 times with a 60s timeout and 5s backoff. The linux build failed once because a savannah mirror redirect (freetype) returned HTTP 500. Route the macOS build through ccache (CC/CXX) like linux and windows; the workflow installs it but the script never used it, so the two-arch build always recompiled from scratch.
This commit is contained in:
@@ -31,7 +31,7 @@ set -e
|
||||
prefix_dir=$PWD/linux_prefix
|
||||
mkdir -p "$prefix_dir"
|
||||
|
||||
wget="wget -nc --progress=bar:force"
|
||||
wget="wget -nc --progress=bar:force --tries=3 --timeout=60 --waitretry=5"
|
||||
|
||||
# Route compilation through ccache (honored by ffmpeg's configure, meson and
|
||||
# CMake alike) so rebuilds after a versions.env bump reuse cached objects. In
|
||||
|
||||
@@ -29,15 +29,18 @@ ARCH=${ARCH:-arm64}
|
||||
prefix_dir=$PWD/macos_prefix-$ARCH
|
||||
mkdir -p "$prefix_dir"
|
||||
|
||||
wget="wget -nc --progress=bar:force"
|
||||
wget="wget -nc --progress=bar:force --tries=3 --timeout=60 --waitretry=5"
|
||||
|
||||
TARGET_FLAG=""
|
||||
if [ "$ARCH" = "x86_64" ]; then
|
||||
TARGET_FLAG="--target=x86_64-apple-darwin"
|
||||
fi
|
||||
|
||||
export CC="cc${TARGET_FLAG:+ $TARGET_FLAG}"
|
||||
export CXX="c++${TARGET_FLAG:+ $TARGET_FLAG}"
|
||||
# Route compilation through ccache (brew-installed by the workflow) so the
|
||||
# two-arch build (arm64 + x86_64) reuses cached objects across rebuilds.
|
||||
CCACHE=${CCACHE:-ccache}
|
||||
export CC="$CCACHE cc${TARGET_FLAG:+ $TARGET_FLAG}"
|
||||
export CXX="$CCACHE c++${TARGET_FLAG:+ $TARGET_FLAG}"
|
||||
export AR=ar
|
||||
export NM=nm
|
||||
export RANLIB=ranlib
|
||||
|
||||
@@ -30,7 +30,7 @@ mkdir -p "$prefix_dir"
|
||||
ln -snf . "$prefix_dir/usr"
|
||||
ln -snf . "$prefix_dir/local"
|
||||
|
||||
wget="wget -nc --progress=bar:force"
|
||||
wget="wget -nc --progress=bar:force --tries=3 --timeout=60 --waitretry=5"
|
||||
|
||||
# -posix is Ubuntu's variant with pthreads support
|
||||
export CC=$TARGET-gcc-posix
|
||||
|
||||
Reference in New Issue
Block a user