What Cabal stuff is permanent?

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. Ideas? -- John

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. Duncan

On Tue, Jun 07, 2005 at 02:06:34PM +0100, Duncan Coutts wrote:
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.
Hmm. I have had several cases where I haven't included these .h files, and things still seem to have worked OK. I do that in MissingPy, for instance. I know that WASH has a .h file that it has not traditionally installed. -- John

On Tue, 2005-06-07 at 08:15 -0500, John Goerzen wrote:
On Tue, Jun 07, 2005 at 02:06:34PM +0100, Duncan Coutts wrote:
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.
Hmm. I have had several cases where I haven't included these .h files, and things still seem to have worked OK. I do that in MissingPy, for instance. I know that WASH has a .h file that it has not traditionally installed.
You're probably just lucky that GHC decided not to inline the FFI call. :-) (and/or the client module was not being compiled -fvia-C) You can get the definitive answer as to whether you're on thin ice from one of the GHC devs. Duncan
participants (2)
-
Duncan Coutts
-
John Goerzen