From 68bbf31a869b8d745454f0bb613f0338a6c5cc90 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 10 Sep 2021 14:59:26 +0200 Subject: [PATCH] Fix download for armv7 container on arm64 host --- scripts/bootstrap/bootstrap-haskell | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/bootstrap/bootstrap-haskell b/scripts/bootstrap/bootstrap-haskell index b5a1dd7..1d18be6 100755 --- a/scripts/bootstrap/bootstrap-haskell +++ b/scripts/bootstrap/bootstrap-haskell @@ -176,7 +176,15 @@ download_ghcup() { _url=${base_url}/${ghver}/armv7-linux-ghcup-${ghver} ;; aarch64|arm64|armv8l) - _url=${base_url}/${ghver}/aarch64-linux-ghcup-${ghver} + # we could be in a 32bit docker container, in which + # case uname doesn't give us what we want + if [ "$(getconf LONG_BIT)" = "32" ] ; then + _url=${base_url}/${ghver}/armv7-linux-ghcup-${ghver} + elif [ "$(getconf LONG_BIT)" = "64" ] ; then + _url=${base_url}/${ghver}/aarch64-linux-ghcup-${ghver} + else + die "Unknown long bit size: $(getconf LONG_BIT)" + fi ;; *) die "Unknown architecture: ${arch}" ;;