From 60cae7f7b5ab6842021dab8a47e1aa81d8562dab Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Thu, 29 Aug 2024 16:23:58 -0700 Subject: [PATCH] Support ARM / M1 macOS in `validate.sh` --- validate.sh | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/validate.sh b/validate.sh index 8784f48b4a5..fc8586a3778 100755 --- a/validate.sh +++ b/validate.sh @@ -299,15 +299,35 @@ JOBS="-j$JOBS" # assume compiler is GHC RUNHASKELL=$(echo "$HC" | sed -E 's/ghc(-[0-9.]*)$/runghc\1/') -case "$(uname)" in +ARCH=$(uname -m) + +case "$ARCH" in + arm64) + ARCH=aarch64 + ;; + x86_64) + ARCH=x86_64 + ;; + *) + echo "Warning: Unknown architecture '$ARCH'" + ;; +esac + +OS=$(uname) + +case "$OS" in MINGW64*) - ARCH="x86_64-windows" + ARCH="$ARCH-windows" + ;; + Linux) + ARCH="$ARCH-linux" ;; - Linux ) - ARCH="x86_64-linux" + Darwin) + ARCH="$ARCH-osx" ;; *) - ARCH="x86_64-osx" + echo "Warning: Unknown operating system '$OS'" + ARCH="$ARCH-$OS" ;; esac