From c1fa1190d3c69b2e0a4c667ea43421b655866e8c Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Wed, 24 Apr 2024 12:37:17 +0200 Subject: [PATCH] build-github.sh: pre-fetch source packages before building We have intermittent build failures due to fetch errors of some large source packages (like linux.git). This commit tries to workaround those failures by downloading all the source packages, with a retries mechanism, before starting the build. Signed-off-by: Javier Viguera --- sdk/build-github.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sdk/build-github.sh b/sdk/build-github.sh index 9f1e07031..55e56cfd1 100755 --- a/sdk/build-github.sh +++ b/sdk/build-github.sh @@ -80,6 +80,18 @@ copy_images() { find "${1}" -type f -not -name MD5SUMS -print0 | xargs -r -0 md5sum | sed -e "s,${1}/,,g" | sort -k2,2 > "${1}"/MD5SUMS } +# +# Pre-fetch all the source packages (with a retries mechanism) +# +fetch_all() { + local FETCH_LOG="fetch.log" + for _ in $(seq 1 3); do + bitbake --runall=fetch "${1}" 2>&1 | tee "${FETCH_LOG}" + grep -qs 'Summary.*ERROR' "${FETCH_LOG}" || break + done + rm -f "${FETCH_LOG}" +} + # # In the buildserver we share the state-cache for all the different platforms # we build in a jenkins job. This may cause problems with some packages that @@ -224,6 +236,7 @@ for platform in ${DY_PLATFORMS}; do } >> conf/local.conf for target in ${platform_targets:?}; do printf "\n[INFO] Building the %s target.\n" "${target}" + time fetch_all "${target}" # shellcheck disable=SC2046 time bitbake "${target}" $(swu_recipe_name "${target}") # Build the toolchain for DEY images