fix(build): refresh the keyring and never partial-upgrade the build host

An idle WSL had a stale keyring ("unknown trust" on every package), and
"pacman -Sy <pkg>" broke on the gcc-libs split into libgcc and libstdc++.
This commit is contained in:
nocode committed 2026-09-22 14:03:06 +02:00
1 parent a603e0d046
commit 255b22316e
1 file changed
+13 -8
+13 -8
View File
@@ -208,8 +208,19 @@ if { [ "$IS_WSL" -eq 1 ] || [ -n "$FWS_IN_CONTAINER" ]; } \
echo "==> WSL/conteneur détecté → DisableSandbox ajouté à /etc/pacman.conf"
fi
echo "==> Mise à jour du trousseau pacman..."
# A WSL left idle for a while has an outdated keyring: every package then fails
# with "signature ... is unknown trust". Refreshing archlinux-keyring alone is
# the one partial upgrade Arch recommends, precisely for this case.
pacman-key --init >/dev/null 2>&1 || true
pacman-key --populate archlinux >/dev/null 2>&1 || true
pacman -Sy --noconfirm --needed archlinux-keyring || true
echo "==> Mise à jour des miroirs et installation de archiso..."
pacman -Sy --noconfirm reflector || true
# Always -Syu, never "-Sy <pkg>": a partial upgrade breaks as soon as Arch
# splits a package (gcc-libs -> libgcc + libstdc++ ended in "conflicting
# files"), while a full upgrade applies the replacement.
pacman -Syu --noconfirm --needed reflector || true
reflector --verbose --latest 10 --sort rate --save /etc/pacman.d/mirrorlist || true
# Reflector peut écrire des miroirs rsync:// que pacman ne sait pas utiliser
# (« Protocol "rsync" not supported » → build mort au premier -Sy, vu en réel).
@@ -224,13 +235,7 @@ if ! grep -q '^Server = ' /etc/pacman.d/mirrorlist 2>/dev/null; then
printf 'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch\n' > /etc/pacman.d/mirrorlist
echo "==> Mirrorlist vide → miroir géo par défaut"
fi
if [ -n "$FWS_IN_CONTAINER" ]; then
# Image de base qui vieillit → upgrade complet AVANT d'ajouter archiso,
# sinon partial upgrade (archiso tire des deps plus récentes que la base).
pacman -Syu --noconfirm archiso
else
pacman -Sy --noconfirm archiso
fi
pacman -Syu --noconfirm --needed archiso
# Vérification syntaxe de l'outil de rapport (pur Python, exécutée côté WSL/hôte)
if command -v python3 >/dev/null 2>&1 \