What Cabal stuff is permanent?

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Tue Jun 7 09:06:34 EDT 2005

On Tue, 2005-06-07 at 12:40 +0000, John Goerzen wrote:
> I have been using the info at
> http://www.haskell.org/ghc/docs/latest/html/Cabal/authors.html as my
> guide to Cabal.
> I recently added an include-dirs line to my .cabal file, only to find
> that ghc-pkg would fail to register this package.  It appears that
> include-dirs was placed into the ghc-pkg file, and of course, the
> relative path doesn't exist at install time and isn't even relevant
> there.
> The problem is: the Cabal docs don't say which fields are "permanent"
> and registered in the package and which aren't.  There are many cases
> where it is not desirable to have fields be "permanent", and this is one
> such case.
> I'm not sure how to specify "just search for .h files here at build time
> of this library" through Cabal.

I suspect that any C .h files you need at build time will also be needed
by programs which use the library that you are building, since GHC can
inline FFI calls across modules in which case the client module needs
the .h files when compiling too. And so they should be installed along
with your library (assuming it is a library and not a program you're
building) and their location mentioned in the .cabal file.

If these .h files are not system header files (ie installed by some
other package and living somwhere under /usr) but are included in your
build tree then you still have the problem that their location is
different between build time and where the get installed eventually. I'm
afraid don't know how Cabal deals with this situation.


More information about the Libraries mailing list