feat(scripts): auto-fallback to Docker container when no Arch WSL distro is found

setup-aur.sh, build.sh and build-offi.sh now fall back to an archlinux
Docker container (repo mounted on /fws, shared pacman cache) instead of
erroring on Windows hosts without an Arch WSL distro. Also install sudo
in the container so makepkg -s can resolve makedepends as the non-root
fwsbuild user (the cause of the recurring anaconda build failure).
This commit is contained in:
BlackAngelTV committed 2026-09-04 14:16:16 +02:00
1 parent ec882afddf
commit 2897a8d876
5 files changed
+108 -4

No files matched your search

+17 -2
View File
@@ -42,6 +42,10 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then
export MSYS_NO_PATHCONV=1
export MSYS2_ARG_CONV_EXCL="*"
# Repli Docker Desktop si aucune distro WSL Arch n'est joignable
# (définit fws_docker_repl, cf. scripts/fws-docker-repl.sh).
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/scripts/fws-docker-repl.sh"
# WSL doit être présent.
command -v wsl.exe >/dev/null 2>&1 \
|| error "WSL introuvable — PowerShell admin : 'wsl --install', puis installe une distro Arch et relance."
@@ -66,7 +70,15 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then
if ! pick_arch_distro; then
warn "Distros WSL installées :"
wsl.exe -l -v 2>/dev/null | tr -d '\0' >&2 || true
error "Aucune distro WSL Arch joignable. Installe ArchWSL (nom 'Arch') ou 'wsl --install -d archlinux', ou exporte ARCH_WSL_DISTRO=<nom>."
# Aucune distro WSL Arch ? Si Docker Desktop tourne, on relance ce
# script dans un conteneur archlinux (même principe que le repli
# podman des hôtes Linux non-Arch). fws_docker_repl sort le script
# lui-même en cas de succès ; sinon on garde le message d'erreur.
SCRIPT_DIR_WIN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -W)"
if fws_docker_repl "setup-aur.sh" "$SCRIPT_DIR_WIN"; then
exit 0
fi
error "Aucune distro WSL Arch joignable (repli Docker indisponible). Installe ArchWSL (nom 'Arch') ou 'wsl --install -d archlinux', ou exporte ARCH_WSL_DISTRO=<nom>."
fi
info "Distro WSL : $DISTRO_NAME"
@@ -198,7 +210,10 @@ fi
# ============================================================
step "1/4 — Outils de build"
# ============================================================
pacman -Sy --needed --noconfirm base-devel git
# sudo : requis par makepkg -s (syncdeps) quand le build tourne dans un
# conteneur (fwsbuild est non-root ; l'image archlinux n'emporte pas sudo).
# Sur Arch natif / WSL, sudo est déjà présent → --needed ne fait rien.
pacman -Sy --needed --noconfirm base-devel git sudo
# ============================================================
step "2/4 — Préparation utilisateur de build (non-root pour makepkg)"