hsc2hs cannot find headers from include dir
Summary
Trying to run hsc2hs and including ghcversion.h
or ghcplatform.h
fails with:
error: ./Foo_hsc_make.c:2:10: fatal error: ghcplatform.h: No such file or directory
2 | #include "ghcplatform.h"
| ^~~~~~~~~~~~~~~
compilation terminated.
Steps to reproduce
- download a binary distribution
- unpack the tarball
./configure --prefix=/ghc945
make install
touch Foo.hsc
/ghc945/bin/hsc2hs -ighcplatform.h -ighcversion.h Foo.hsc
Expected behavior
hsc2hs should be able to find the headers from the includedir.
Looking into the generated hsc2hs wrapper script, it has:
!/bin/bash
exedir="/ghc945/lib/bin"
exeprog="./hsc2hs-ghc-9.4.5"
executablename="/ghc945/lib/bin/./hsc2hs-ghc-9.4.5"
bindir="/ghc945/bin"
libdir="/ghc945/lib/lib"
docdir="/ghc945/doc"
includedir="/ghc945/include"
But the includedir
directory does not exist. However, there is an include
directory present in the tarball, and when I cp -r ~/bindist_unpacked/include/ /ghc945/
it starts to work.
Environment
- GHC version used: 9.4.5
Optional:
- Operating System: linux
- System Architecture: amd64