Changing the GHC version for my project

I am trying to set up Duckling. When I try stack build, I get this error.

[ Error ] [GHCup-00130] The version 8.8.4 of the tool ghc is not installed.
[ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.8.yaml as file /Users/viramesh/.ghcup/cache/ghcup-0.0.8.yaml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
[ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.8.2'
[ Warn  ] New hls version available. If you want to install this latest version, run 'ghcup install hls 2.7.0.0'
[ Warn  ] New stack version available. If you want to install this latest version, run 'ghcup install stack 2.15.1'
[ Error ] [GHCup-00010] Unable to find a download for 8.8.4
[ Error ] Also check the logs in /Users/<user>/.ghcup/logs
Installing 8.8.4 via ghcup failed exit 3

Warning: Path to GHC binary is not a valid path: .

Error: [S-9443]
       No setup information found for ghc-8.8.4 on your platform. This probably means a GHC binary distribution has not yet been added for OS key macosx-aarch64. Supported versions: ghc-8.10.5,
       ghc-8.10.6, ghc-8.10.7, ghc-9.0.2, ghc-9.2.1, ghc-9.2.2, ghc-9.2.3, ghc-9.2.4, ghc-9.2.5, ghc-9.2.6, ghc-9.2.7, ghc-9.2.8, ghc-9.4.1, ghc-9.4.2, ghc-9.4.3, ghc-9.4.4, ghc-9.4.5, ghc-9.4.6,
       ghc-9.4.7, ghc-9.4.8, ghc-9.6.1, ghc-9.6.2, ghc-9.6.3, ghc-9.6.4, ghc-9.8.1 and ghc-9.8.2.

How do I change the version that stack uses for the project? I can’t use 8.8.4 since it is not available through GHCup on Apple Silicon

You need to change the resolver in (some?) stack.yaml to something current, a LTS version:

https://www.stackage.org/snapshots

This worked. Thank you!

1 Like

Your question has been answered, but for others with a similar question the following parts of Stack’s online documentation may help:

and for a more tutorial-like approach to the same topic:

1 Like