From b8986116d68258c48eccc720a776805a62198f0b Mon Sep 17 00:00:00 2001 From: david Date: Fri, 2 Oct 2026 19:19:48 +0200 Subject: [PATCH] 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. --- ci/build-libmpv-linux.sh | 2 +- ci/build-libmpv-macos.sh | 9 ++++++--- ci/build-libmpv-mingw64.sh | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ci/build-libmpv-linux.sh b/ci/build-libmpv-linux.sh index b3a31c2..2745fda 100644 --- a/ci/build-libmpv-linux.sh +++ b/ci/build-libmpv-linux.sh @@ -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 diff --git a/ci/build-libmpv-macos.sh b/ci/build-libmpv-macos.sh index e0ec7f3..434a72c 100644 --- a/ci/build-libmpv-macos.sh +++ b/ci/build-libmpv-macos.sh @@ -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 diff --git a/ci/build-libmpv-mingw64.sh b/ci/build-libmpv-mingw64.sh index c175635..241a4e2 100644 --- a/ci/build-libmpv-mingw64.sh +++ b/ci/build-libmpv-mingw64.sh @@ -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