From bd5288c7c2a9e3e8ae86799c0a5642443a574f59 Mon Sep 17 00:00:00 2001 From: Nikita Bykov <49442273+nikita-bykov@users.noreply.github.com> Date: Mon, 20 Sep 2021 13:13:00 +0300 Subject: [PATCH] [macOS] Improve haskell setup (#4071) Freeing up disk space on macOS by removing docs and profiling libs of GHC. --- images/macos/provision/core/haskell.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/images/macos/provision/core/haskell.sh b/images/macos/provision/core/haskell.sh index 342c5f6ec..f79b58976 100644 --- a/images/macos/provision/core/haskell.sh +++ b/images/macos/provision/core/haskell.sh @@ -14,6 +14,15 @@ for majorMinorVersion in $minorMajorVersions; do echo "install ghc version $fullVersion..." ghcup install $fullVersion ghcup set $fullVersion + + # remove docs and profiling libs + ghc_bin_dir="$(ghcup whereis --directory ghc $fullVersion)" + [ -e "${ghc_bin_dir}" ] || exit 1 + ghc_dir="$( cd "$( dirname "${ghc_bin_dir}" )" > /dev/null 2>&1 && pwd )" + [ -e "${ghc_dir}" ] || exit 1 + find "${ghc_dir}" \( -name "*_p.a" -o -name "*.p_hi" \) -type f -delete + rm -r "${ghc_dir}"/share/* + unset ghc_bin_dir ghc_dir done echo "install cabal..."