Error accessing data files from package code in Cabal: Unkown symbol

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Jul 2 09:57:04 EDT 2008


On Tue, 2008-07-01 at 14:10 -0500, Alfonso Acosta wrote:
> On Tue, Jul 1, 2008 at 1:26 PM, Don Stewart <dons at galois.com> wrote:
> > Probably you've not listed the Paths_ForSyDe module in your module
> > exports in the .cabal file?
> 
> Thanks, that was the problem.
> 
> Since Paths_pkgname is somehow a special module, I stupidly assumed
> that cabal would take care of exporting it under the hood. I hope that
> the directory where the Paths_pkgname is included (dist/build/autogen
> ) doesn't change in the future.

Do not hard code the path. It can change (via a command line flag).

It's not necessary to hard code anything anyway, just using:

other-modules: Paths_ForSyDe

will work fine (because the $dist/build/autogen path is on the sources
search path)

I suggest using other-modules rather than exposed-modules because you
probably do not need to make that module part of your public api.

> Either way, I think it would be a good idea to include a comment about
> it in the Cabal documentation
> (http://www.haskell.org/cabal/release/latest/doc/users-guide/authors.html#paths-module
> ).

Right.

Duncan



More information about the Libraries mailing list