Against my better judgement, I went ahead and upgraded my macOS version to Ventura. I use a 2021 M1 Pro machine. Below are the various errors I encounter when trying the various actions listed in this post’s title.
% ghci GHCi, version 9.4.2: https://www.haskell.org/ghc/ :? for help xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun `gcc' failed in phase `gcc'. (Exit code: 1)
[ Info ] Installing GHC (this may take a while) [ ghc-configure ] not found (too old?) [ ghc-configure ] checking for gcc... gcc [ ghc-configure ] checking whether the C compiler works... no [ ghc-configure ] configure: error: in `/Users/myusername/.ghcup/tmp/ghcup-1e1054df9ffa4cb3/ghc-9.4.3-aarch64-apple-darwin': [ ghc-configure ] configure: error: C compiler cannot create executables [ ghc-configure ] See `config.log' for more details [ Error ] Process "sh" with arguments ["./configure", [ ... ] "--prefix=/Users/myusername/.ghcup/ghc/9.4.3", [ ... ] "--disable-ld-override"] failed with exit code 77. [ Error ] Also check the logs in /Users/myusername/.ghcup/logs
% ghc test.hs [1 of 2] Compiling Main ( test.hs, test.o ) <no location info>: error: Warning: Couldn't figure out C compiler information! Make sure you're using GNU gcc, or clang xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun <no location info>: error: `gcc' failed in phase `Assembler'. (Exit code: 1)
It looks like a C compiler problem, but I don’t know what else to do. I’m personally not in a hurry because I have another machine on which to use Haskell, but it is somewhat unfortunate and inconvenient to be unable to use GHC on this particular machine at the moment.
Does anyone know what I could try to make things work again? Thank you.