Skip to content

Commit 40e423d

Browse files
hexbyt3claude
andcommitted
CI: make dependency sync resilient to devkitPro mirror 403s
Retry the package DB sync and fall back to the container's preinstalled libnx/portlibs if the mirror stays unreachable, instead of hard-failing the build under sh -e. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4813395 commit 40e423d

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,25 @@ jobs:
2020

2121
- name: Install dependencies
2222
run: |
23-
# Refresh the package DB and pull the latest libnx + portlibs so
24-
# the build always targets current firmware/Atmosphere support
25-
# rather than whatever libnx the container image was baked with.
26-
dkp-pacman -Sy --noconfirm
27-
dkp-pacman -S --noconfirm --needed libnx switch-curl switch-mbedtls switch-zlib
23+
# Best-effort: refresh the DB and pull the latest libnx + portlibs so
24+
# the build targets current firmware/Atmosphere support rather than
25+
# whatever the container image was baked with. The devkitPro mirror
26+
# intermittently 403s, so retry the sync and, if it stays down, fall
27+
# back to the versions preinstalled in the container instead of
28+
# failing the build.
29+
synced=0
30+
for i in 1 2 3; do
31+
if dkp-pacman -Sy --noconfirm; then synced=1; break; fi
32+
echo "package DB sync attempt $i failed; retrying in 10s..."; sleep 10
33+
done
34+
if [ "$synced" = 1 ]; then
35+
dkp-pacman -S --noconfirm --needed libnx switch-curl switch-mbedtls switch-zlib \
36+
|| echo "package install failed; using preinstalled versions"
37+
else
38+
echo "package DB sync failed after retries; using preinstalled versions"
39+
fi
2840
echo "## Toolchain" >> $GITHUB_STEP_SUMMARY
29-
dkp-pacman -Q libnx switch-curl switch-mbedtls switch-zlib | tee -a $GITHUB_STEP_SUMMARY
41+
dkp-pacman -Q libnx switch-curl switch-mbedtls switch-zlib | tee -a $GITHUB_STEP_SUMMARY || true
3042
3143
- name: Build
3244
run: make

0 commit comments

Comments
 (0)