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