Couldn't install latest ghc, problem with `sh`
I couldn't install latest ghc (9.2.2)
❯ ghcup install ghc latest
[ Info ] downloading: https://downloads.haskell.org/~ghc/9.2.2/ghc-9.2.2-x86_64-fedora27-linux.tar.xz as file /tmp/ghcup-826ffd79f4ea41c5/ghc-9.2.2-x86_64-fedora27-linux.tar.xz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 236M 100 236M 0 0 47.2M 0 0:00:05 0:00:05 --:--:-- 48.9M
[ Info ] verifying digest of: ghc-9.2.2-x86_64-fedora27-linux.tar.xz
[ Info ] Unpacking: ghc-9.2.2-x86_64-fedora27-linux.tar.xz to /tmp/ghcup-cdc002445c05b95b
[ Info ] Installing GHC (this may take a while)
[ ghc-configure ] checking Setting up CONF_CC_OPTS_STAGE1, CONF_GCC_LINKER_OPTS_STAGE1, CONF_LD_LINKER_OPTS_STAGE1 and CONF_C...
[ ghc-configure ] checking Setting up CONF_CC_OPTS_STAGE2, CONF_GCC_LINKER_OPTS_STAGE2, CONF_LD_LINKER_OPTS_STAGE2 and CONF_C...
[ ghc-configure ] checking for .subsections_via_symbols... no
[ ghc-configure ] checking whether your assembler supports .ident directive... yes
[ ghc-configure ] checking for GNU non-executable stack support... yes
[ ghc-configure ] checking whether CC supports --target... ./configure: 7723: Syntax error: Bad fd number
[ Error ] (Process "sh" with arguments ["./configure",
[ ... ] "--prefix=/home/user/.local/share/ghcup/ghc/9.2.2"] failed with exit code 2.,
[ ... ] ())
[ Error ] Also check the logs in /home/user/.local/cache/ghcup/logs
where the error points an issue with sh
.
Using Arch Linux I had changed the symlink of /usr/bin/sh
from bash [the default] to dash.
Changing it back to bash fixed the issue.