Broken bindist install with hadrian
Building a bindist with Hadrian works:
> ./hadrian/build.stack.sh -c -j binary-dist
> ./_build/bindist/ghc-8.9.20190320-x86_64-unknown-linux/bin/ghc
ghc: no input files
Usage: For basic information, try the `--help' option.
But installing it with "make install" doesn't:
> mkdir /tmp/ghc-install
> cd _build/bindist/ghc-8.9.20190320-x86_64-unknown-linux
> ./configure --prefix=/tmp/ghc-install
> make install
[...]
/tmp/ghc-install/lib/ghc-8.9.20190320/bin/ghc-pkg: error while loading shared libraries: libHSterminfo-0.4.1.3-ghc8.9.20190320.so: cannot open shared object file: No such file or directory
make: *** [Makefile:122: update_package_db] Error 127
> /tmp/ghc-install/bin/ghc
/tmp/ghc-install/lib/ghc-8.9.20190320/bin/ghc: error while loading shared libraries: libHShaskeline-0.7.5.0-ghc8.9.20190320.so: cannot open shared object file: No such file or directory
It seems to be a problem with RPATH and/or file copy as we can see with the following session:
> readelf -d /tmp/ghc-install/lib/ghc-8.9.20190320/bin/ghc | grep RUNPATH
0x000000000000001d (RUNPATH) Bibliothèque runpath:[$ORIGIN/../lib/x86_64-linux-ghc-8.9.20190320:_build/stage1/lib/../lib/x86_64-linux-ghc-8.9.20190320]
> mkdir /tmp/ghc-install/lib/ghc-8.9.20190320/lib
> mv /tmp/ghc-install/lib/* /tmp/ghc-install/lib/ghc-8.9.20190320/lib
> /tmp/ghc-install/lib/ghc-8.9.20190320/bin/ghc
ghc: no input files
Usage: For basic information, try the `--help' option.