I am trying to run ghci for the first time after a successful installation of Haskell 9.4.8.
After issuing ghci command, I am faced with this message:
/root/.ghcup/ghc/9.4.8/bin/ghc-9.4.8: line 12: /root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin/./ghc-9.4.8: No such file or directory
I looked at the installation directory structure and found that subdirectories “/bin/./ghc-9.4.8” do not exist under “/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/” – as the error message suggests.
My installation uses two scripts to try to launch ghci, /root/.ghcup/ghc/9.4.8/bin/ghci-9.4.8 – which in turn calls /root/.ghcup/ghc/9.4.8/bin/ghc-9.4.8. This second script makes reference to the missing subdirectory and file, causing the ghci invocation to fail. The scripts are straightforward, setting up some variables then calling something in each case.
Script ghci-9.4.8
#!/bin/sh
set -xv
echo "In GHCI 9.4.8"
exedir="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin"
exeprog="./ghci-9.4.8"
executablename="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin/./ghci-9.4.8"
bindir="/root/.ghcup/ghc/9.4.8/bin"
libdir="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/lib"
docdir="/root/.ghcup/ghc/9.4.8/share/doc/ghc-9.4.8"
includedir="/root/.ghcup/ghc/9.4.8/include"
executable="$bindir/ghc-9.4.8"
exec $executable --interactive "$@"
Script ghc-9.4.8
#!/bin/sh
set -xv
echo "In GHC 9.4.8"
exedir="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin"
exeprog="./ghc-9.4.8"
executablename="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin/./ghc-9.4.8"
bindir="/root/.ghcup/ghc/9.4.8/bin"
libdir="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/lib"
docdir="/root/.ghcup/ghc/9.4.8/share/doc/ghc-9.4.8"
includedir="/root/.ghcup/ghc/9.4.8/include"
exec "$executablename" -B"$libdir" ${1+"$@"}
I added a couple of eye-catcher “echo” statements into these scripts to help identify the flow and added “set -xv” to both to elaborate the activity taking place. Execution output here:
opensuse-64:~ # ghci
echo "In GHCI 9.4.8"
+ echo 'In GHCI 9.4.8'
In GHCI 9.4.8
exedir="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin"
+ exedir=/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin
exeprog="./ghci-9.4.8"
+ exeprog=./ghci-9.4.8
executablename="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin/./ghci-9.4.8"
+ executablename=/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin/./ghci-9.4.8
bindir="/root/.ghcup/ghc/9.4.8/bin"
+ bindir=/root/.ghcup/ghc/9.4.8/bin
libdir="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/lib"
+ libdir=/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/lib
docdir="/root/.ghcup/ghc/9.4.8/share/doc/ghc-9.4.8"
+ docdir=/root/.ghcup/ghc/9.4.8/share/doc/ghc-9.4.8
includedir="/root/.ghcup/ghc/9.4.8/include"
+ includedir=/root/.ghcup/ghc/9.4.8/include
executable="$bindir/ghc-9.4.8"
+ executable=/root/.ghcup/ghc/9.4.8/bin/ghc-9.4.8
exec $executable --interactive "$@"
+ exec /root/.ghcup/ghc/9.4.8/bin/ghc-9.4.8 --interactive
echo "In GHC 9.4.8"
+ echo 'In GHC 9.4.8'
In GHC 9.4.8
exedir="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin"
+ exedir=/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin
exeprog="./ghc-9.4.8"
+ exeprog=./ghc-9.4.8
executablename="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin/./ghc-9.4.8"
+ executablename=/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin/./ghc-9.4.8
bindir="/root/.ghcup/ghc/9.4.8/bin"
+ bindir=/root/.ghcup/ghc/9.4.8/bin
libdir="/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/lib"
+ libdir=/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/lib
docdir="/root/.ghcup/ghc/9.4.8/share/doc/ghc-9.4.8"
+ docdir=/root/.ghcup/ghc/9.4.8/share/doc/ghc-9.4.8
includedir="/root/.ghcup/ghc/9.4.8/include"
+ includedir=/root/.ghcup/ghc/9.4.8/include
exec "$executablename" -B"$libdir" ${1+"$@"}
+ exec /root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin/./ghc-9.4.8 -B/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/lib --interactive
/root/.ghcup/ghc/9.4.8/bin/ghc-9.4.8: line 12: /root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/bin/./ghc-9.4.8: No such file or directory
You will note the failure in the last line.
Question is, should there be a “/bin” directory with contents under “/root/.ghcup/ghc/9.4.8/lib64/ghc-9.4.8/”?
Any help appreciated.