From b92fd9b1fd55e6a434efba7dcf63b6798e7801c9 Mon Sep 17 00:00:00 2001 From: "Aleksei (Faumaray) Selikhov" Date: Sun, 6 Dec 2026 09:36:03 +0300 Subject: [PATCH] ci: retry the self-hosted install in a fresh build directory The provider snapshot tree has been sealed with missing source files (the same content-addressed tree id across runs), and a sealed tree is not rebuilt. Retry once from a fresh build directory instead of failing the installer job. --- .gitea/workflows/ci.yml | 57 +++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 442bd1a..e5959bc 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -251,6 +251,29 @@ jobs: # self-hosted build directory is unique per run. The first install builds the # project with VBS (build.cpp); the rest reuse it. build_dir="build/selfhost-${GITHUB_RUN_ID}" + # The provider snapshot materialization has been observed to seal an + # incomplete tree (missing source files); a sealed tree is not rebuilt, + # so a retry starts from a fresh build directory. + install_archive() { + local fmt="$1" ext="$2" + local attempt=1 + while true; do + if "${vbs}" install --project . --build-dir "${build_dir}" --profile release \ + --prefix "${prefix}" --package-name VoidBuildSystem \ + --package-version "${version}" \ + --archive "${out}/vbs-${label}-linux-x86_64-${fmt}.${ext}" \ + --archive-format "${fmt}"; then + return 0 + fi + if [ "${attempt}" -ge 2 ]; then + echo "vbs install (${fmt}) failed after retry" >&2 + return 1 + fi + attempt=$((attempt + 1)) + build_dir="${build_dir}-retry${attempt}" + echo "retrying vbs install (${fmt}) in '${build_dir}'..." >&2 + done + } for fmt in tar sh zip deb rpm wix dmg nuget; do case "${fmt}" in tar) ext=tar ;; @@ -258,11 +281,7 @@ jobs: nuget) ext=nupkg ;; *) ext="${fmt}" ;; esac - "${vbs}" install --project . --build-dir "${build_dir}" --profile release \ - --prefix "${prefix}" --package-name VoidBuildSystem \ - --package-version "${version}" \ - --archive "${out}/vbs-${label}-linux-x86_64-${fmt}.${ext}" \ - --archive-format "${fmt}" + install_archive "${fmt}" "${ext}" done ls -l "${out}/" - name: Upload the installers @@ -304,6 +323,27 @@ jobs: prefix="$(mktemp -d)" mkdir -p "${out}" build_dir="build/selfhost-windows-${GITHUB_RUN_ID}" + install_archive() { + local fmt="$1" ext="$2" + local attempt=1 + while true; do + if "${vbs}" install --project . --build-dir "${build_dir}" --profile release \ + --target-os windows --target-arch x86_64 \ + --prefix "${prefix}" --package-name VoidBuildSystem \ + --package-version "${version}" \ + --archive "${out}/vbs-${label}-windows-x86_64-${fmt}.${ext}" \ + --archive-format "${fmt}"; then + return 0 + fi + if [ "${attempt}" -ge 2 ]; then + echo "vbs install (${fmt}) failed after retry" >&2 + return 1 + fi + attempt=$((attempt + 1)) + build_dir="${build_dir}-retry${attempt}" + echo "retrying vbs install (${fmt}) in '${build_dir}'..." >&2 + done + } for fmt in tar zip nuget wix; do case "${fmt}" in tar) ext=tar ;; @@ -311,12 +351,7 @@ jobs: nuget) ext=nupkg ;; *) ext="${fmt}" ;; esac - "${vbs}" install --project . --build-dir "${build_dir}" --profile release \ - --target-os windows --target-arch x86_64 \ - --prefix "${prefix}" --package-name VoidBuildSystem \ - --package-version "${version}" \ - --archive "${out}/vbs-${label}-windows-x86_64-${fmt}.${ext}" \ - --archive-format "${fmt}" + install_archive "${fmt}" "${ext}" done ls -l "${out}/" - name: Upload the Windows installers