haskell-suite / haskell-names

Haskell suite library for name resolution
52 stars 17 forks source link

HsFFI.h isn't found when using hs-gen-iface #44

Closed ghost closed 9 years ago

ghost commented 11 years ago
ζ: ~/.cabal/bin/cabal install primitive --haskell-suite -w hs-gen-iface  
Resolving dependencies...
Configuring primitive-0.5.1.0...
cabal: Missing dependency on a foreign library:
* Missing (or bad) header file: primitive-memops.h
This problem can usually be solved by
[...]
the error messages.
Failed to install primitive-0.5.1.0
cabal: Error: some packages failed to install:
primitive-0.5.1.0 failed during the configure step. The exception was:
ExitFailure 1

When running with -v3, we see that HsFFI.h isn't found:

("/usr/bin/gcc",["/tmp/17376.c","-o","/tmp/17376","-D__HASKELL_SUITE__","-Dlinux_HOST_OS=1","-Dx86_64_HOST_ARCH=1","-Idist/build/autogen","-Icbits","-I.","-O3","-ftree-vectorize","-fomit-frame-pointer","-msse2","-I/home/feuerbach/.cabal/lib/i386-linux-haskell-names-0.2/base-4.7.0.0/include","-O3","-ftree-vectorize","-fomit-frame-pointer","-msse2","-L/home/stijn/.cabal/share/x86_64-linux-ghc-7.6.3/haskell-names-0.3.1/libraries/base-4.7.0.0","-L/home/stijn/.cabal/share/x86_64-linux-ghc-7.6.3/haskell-names-0.3.1/libraries/integer-simple-0.1.1.0","-L/home/stijn/.cabal/share/x86_64-linux-ghc-7.6.3/haskell-names-0.3.1/libraries/ghc-prim-0.3.1.0"])
/usr/bin/gcc returned ExitFailure 1 with error message:
In file included from /tmp/17376.c:1:0:
cbits/primitive-memops.h:5:19: fatal error: HsFFI.h: No such file or directory
#include <HsFFI.h>
^
compilation terminated.

This problem doesn't occur during normal use of cabal-install. --extra-include-dirs=/usr/lib/ghc/include is a quick fix to the problem.

UnkindPartition commented 11 years ago

So, what's your conclusion here? Is there something to be fixed in haskell-names? Or in the primitive package? Or should we just bundle a pre-compiled version of primitive?

ghost commented 11 years ago

I think it's due to haskell-names, because I've seen it happen in other packages. The workaround seems to work fine for them, but I don't know whether it'll fix all problems like this one. I also don't know how this problem occurs, because I'm not (yet) familiar enough with hs-gen-iface's innards.

phischu commented 9 years ago

Going forward I want to remove the dependency on haskell-packages and support for hs-gen-iface. Sorry.