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 bdfc231a2b
commit d881e4f185
5 files changed
+108 -4

No files matched your search

+12
View File
@@ -32,6 +32,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 (sinon message clair plutôt que command not found).
command -v wsl.exe >/dev/null 2>&1 || {
echo -e "\e[31mWSL introuvable. Installe WSL2 puis une distro Arch :\e[0m" >&2
@@ -63,6 +67,14 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" || -n "$WINDIR" ]]; then
echo -e "\e[31mAucune distribution WSL Arch joignable.\e[0m" >&2
echo "Distros WSL installées :" >&2
wsl.exe -l -v 2>/dev/null | tr -d '\0' >&2 || true
# 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 "build-offi.sh" "$SCRIPT_DIR_WIN"; then
exit 0
fi
echo "" >&2
echo "Installe Arch dans WSL puis relance :" >&2
echo " - ArchWSL (yuk7) — s'enregistre sous 'Arch' : https://github.com/yuk7/ArchWSL/releases/latest" >&2