Skip to content

Unable to install GHC on AWS Graviton ARM64 instances

Summary

I am unable to install GHC 8.10.7, 9.0.2 or 9.2.1 on a AWS Graviton based ARM64 instance installing from within docker, using debian buster as a base image. I have also tried installing with ghcup on the EC2 host directly but it fails with the same error.

I have tried 'Amazon Linux' (based on red hat), ubuntu 18.04 and ubuntu 20.04 AMIs, however they all fail in the same way.

For context, I am trying to add ARM64 support to the Haskell docker images and I am trying to test if they work.

Steps to reproduce

  1. In AWS Console create a 'Ubuntu Server 20.04 LTS' ec2 instance, selecting '64-bit (Arm)' as the processor type.
  2. You probably want ~30GB of storage to be able to install GHC.
  3. Launch + ssh into the instance.
  4. Install ghcup prereqs sudo apt update && sudo apt install build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 libncurses-dev libncurses5 libtinfo5
  5. Install ghcup curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh you can select whatever for the prompts. This will install ghc-8.10.7-aarch64-deb10-linux.tar.xz (same GHC dist as the docker case) which will fail.
  6. View the logs cat /home/ubuntu/.ghcup/logs/ghc-make.log. You should get a failure like:
Registering library for libiserv-8.10.7..
"utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist" register compiler stage2 "/home/ubuntu/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/bin/ghc" "/home/ubuntu/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/bin/ghc-pkg" "/home/ubuntu/.ghcup/ghc/8.10.7/lib/ghc-8.10.7" '' '/home/ubuntu/.ghcup/ghc/8.10.7' '/home/ubuntu/.ghcup/ghc/8.10.7/lib/ghc-8.10.7' '/home/ubuntu/.ghcup/ghc/8.10.7/share/doc/ghc-8.10.7/html/libraries' NO
ghc-cabal: '/home/ubuntu/.ghcup/ghc/8.10.7/lib/ghc-8.10.7/bin/ghc' exited with
an error:

make[1]: *** [ghc.mk:986: install_packages] Error 1
make: *** [Makefile:51: install] Error 2

All GHC versions I tested produce the same error. ghcup (and my docker tests) are doing something like:

$ ./configure --prefix "/opt/ghc/8.10.7"
$ make install # this fails

so I do not believe the installation method is incorrect.

Alternatively you can clone https://github.com/haskell/docker-haskell/pull/53 and checkout the travis-arm branch and docker build 8.10/buster (after installing docker) and it should produce the same failure. Happy to provide more detailed steps if required for this approach.

Expected behavior

Install GHC successfully.

Environment

  • GHC version used: 8.10.7, 9.0.2, 9.2.1

Optional:

  • Operating System: Ubuntu 20.04
  • System Architecture: ARM64
Edited by Alistair Burrowes
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information